DistrictDataLabs / yellowbrick

Visual analysis and diagnostic tools to facilitate machine learning model selection.
http://www.scikit-yb.org/
Apache License 2.0
4.3k stars 559 forks source link

Object has no attribute 'target_type_' #1195

Closed fazaghifari closed 3 years ago

fazaghifari commented 3 years ago

Hi! So I was trying plotting a multiclass ROC following this reference

However, the model I used is already trained and wrapped with CalibratedClassifierCV from sklearn because I need to calibrate the predict_proba in my model. But it returns 'CalibratedClassifierCV' object has no attribute 'target_type_'

Here's the code I use:

visualizer = ROCAUC(my_trained_model, classes = my_classes)
visualizer.score(x_valid, y_valid)
visualizer.show()

Did I miss something?

fazaghifari commented 3 years ago

Ah, my mistake! Although you already trained your model, you'll need to fit the visualizer again.

Cheers!