Issue
I am trying to run a Random Forest Classifier in 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)
Then I get this error:
ndarray should be a binary classifier
Solution
The first argument passed to plot_roc_curve
should be your estimator object model_rf_man
. See the docs
Answered By - ClimbingTheCurve
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.