![](/img/trans.png)
[英]Error Y_pred This LinearRegression instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator
[英]How do I call 'fit' appropriate arguments before using this estimator?
# predict - Predict class labels for samples in X
log_reg.predict(X_train).fit
y_pred = log_reg.predict(X_train).fit
# predict_proba - Probability estimates
pred_proba = log_reg.predict_proba(X_train)
# coef_ - Coefficient of the features in the decision function
log_reg.coef_
NotFittedError:尚未拟合此 LogisticRegression 实例。 在使用此估算器之前,使用适当的 arguments 调用“fit”。
# fit classifier on train data
clf = log_reg.fit(X_train, y_train)
# predict on test data
y_pred = clf.predict(X_test)
# predict probabilities on test data
pred_proba = clf.predict_proba(X_test)
# coefficient of the features in the decision function
print(clf.coef_)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.