【发布时间】:2020-11-29 14:25:39
【问题描述】:
# 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 实例尚未拟合。在使用此估算器之前,使用适当的参数调用“fit”。
【问题讨论】:
-
您需要先将模型拟合到训练集上,然后才能在测试集上进行预测。
标签: python python-3.x jupyter-notebook