when I run this piece of code:
from yellowbrick.classifier import ROCAUC
from sklearn.ensemble import RandomForestClassifier
rf = RandomForestClassifier(**{"max_features": 0.4, "n_estimators":15,"min_samples_leaf": 0.1,"random_state":42})
rf.fit(X_train, y_train)
roc_viz = ROCAUC(rf)
roc_viz.score(X_test, y_test)
I have this error
'RandomForestClassifier' object has no attribute 'target_type_'
Somebody has an idea ? Thank you
And when I debug, at the instruction
roc_viz = ROCAUC(rf)
I get the error:
unable to get repr for <class 'yellowbrick.classifier.rocauc.ROCAUC'
A couple of things
You always need to fit the visualizer
If you have already fitted your model then you must set the param
is_fittedto Truerf = RandomForestClassifier(**{"max_features": 0.4, "n_estimators":15,"min_samples_leaf": 0.1,"random_state":42})
rf.fit(X_train, y_train)
roc_viz = ROCAUC(rf, is_fitted=True)
roc_viz.fit(X_train, y_train)
roc_viz.score(X_test, y_test)