Issue with show using gridsearchCV object

34 views
Skip to first unread message

Moreno Colaiacovo

unread,
Jan 15, 2020, 6:38:39 AM1/15/20
to Yellowbrick
Hello everyone

I have recently installed Yellowbrick to create a ROC curve for a multiclass classificator, but I am getting an error when I launch visualizer.show().

The model is actually a GridSearchCV object, and apparently it doesn't have the requested "show" attribute. Is it possible to overcome this issue in some way?

I am attaching a screenshot with the error.

Thank you in advance for your help!

Best,
Moreno
gridsearch_ROCAUC.jpg

Lawrence Gray

unread,
Jan 15, 2020, 8:21:38 AM1/15/20
to Yellowbrick
Hi Moreno,  Thanks for using Yellowbrick.  If I could get some more information from you so that I can respond appropriately.  If I don't have the answer I am sure that one of my colleagues will be able to assist you.

What version of Yellowbrick are you using?  What OS are you using?  What estimator are you using within the GridSearchCV?  What parameters are you using with the GridSearchCV?

Cheers,
Larry

Moreno Colaiacovo

unread,
Jan 15, 2020, 8:39:02 AM1/15/20
to Yellowbrick
Hi Larry and thank you for your reply.

I am using Yellowbrick 0.9 and scikit-learn 0.20.3 on a Windows 10 machine (Python 2.7.16).

Here is the code to generate the gridsearch object on which I ran the Yellowbrick ROCAUC function:

P = Pipeline([('scaler', PowerTransformer()),('selection', RFECV(LogisticRegression())),('classifier', BaggingClassifier(random_state=0))])
K
= {'classifier__n_estimators': [10,15,20,25,30]}
gridsearch
= GridSearchCV(P, K, verbose=1, cv=5, scoring='neg_mean_squared_error', n_jobs=2).fit(X_train,Y_train)    

I hope you can help me!

Best,
Moreno

Lawrence Gray

unread,
Jan 15, 2020, 10:57:24 AM1/15/20
to Yellowbrick
Thanks for the info... There are 3 things I wanted to comment on that will alleviate your issue.

  • 1. v0.9 does not have a show() method — it has the poof() method
  • 2. GridSearchCV is the underlying estimator, any method/attribute that isn’t on ROCAUC gets passed to the estimator, which is why the error method is saying what it is saying. Visualizers are just wrappers for estimators.
  • 3. You should upgrade to v1.0 to use show() and other new features, but we don’t support python 2.7 anymore, so it will also require an update to your python version to get the latest version of yellowbrick
Cheers,
Larry and Ben

Moreno Colaiacovo

unread,
Jan 16, 2020, 11:42:31 AM1/16/20
to Yellowbrick
I used v1.0 on Python 3 and now it works! Thank you Lawrence! :-)
Reply all
Reply to author
Forward
0 new messages