0

I am using below code to get best hyper parameter which will give the maximum AUC value through grid search. but i am not able to plot it.

 model = KNeighborsClassifier()
 #Hyper Parameters Set
 params = {'n_neighbors':[5,10,15,20,25,30,35],
      'leaf_size':[1,2,3,4],
      'weights':['uniform', 'distance'],
      'algorithm':['brute']
      }
#Making models with hyper parameters sets
model1_tfidf = GridSearchCV(model, param_grid=params)
model1_tfidf.fit(final_X_train_tfidf,y_train)
print("Best Hyper Parameters:\n",model1.best_params_)
shaik moeed
  • 5,300
  • 1
  • 18
  • 54
Saikat
  • 1
  • 1
  • You'll need `from sklearn.metrics import plot_roc_curve` and then use the name of your gridsearch `plot_roc_curve(model1_tfidf, X_test, y_test)` here on the hold out sample or training set if you wish. – R. Prost May 16 '21 at 19:09

1 Answers1

0

GridsearchCV just returns CV scores but it will not plot roc curve.

Follow the below stack overflow link: How to plot ROC curve in Python