ndarray 应该是二元分类器错误

我正在尝试在 sklearn 中运行随机森林分类器:

from sklearn.ensemble import RandomForestClassifier
model_rf_man = RandomForestClassifier(n_estimators= 183, max_features= 'sqrt', max_depth = 10, min_samples_split=5, min_samples_leaf = 3, bootstrap = True) 
model_rf_man.fit(x_training_data, y_training_data)
y_pred_rf_man = model_rf_man.predict(x_test_data)

from sklearn.metrics import classification_report
from sklearn.metrics import plot_roc_curve
print(classification_report(y_test_data, y_pred_rf_man))
plot_roc_curve(y_pred_rf_man, x_test_data, y_test_data)

然后我得到这个错误:

ndarray should be a binary classifier
攀登曲线

传递给的第一个参数plot_roc_curve应该是您的估算器对象model_rf_man查看文档

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章