【问题标题】:How to plot AUC for best hyper parameters through grid search如何通过网格搜索绘制 AUC 以获得最佳超参数
【发布时间】:2020-10-06 20:32:23
【问题描述】:

我正在使用下面的代码来获得最佳超参数,这将通过网格搜索给出最大的 AUC 值。但我无法绘制它。

 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_)

【问题讨论】:

标签: parameters data-science knn auc hyper


【解决方案1】:

GridsearchCV 只返回 CV 分数,但不会绘制 roc 曲线。

按照下面的堆栈溢出链接: How to plot ROC curve in Python

【讨论】:

    猜你喜欢
    • 2019-10-11
    • 2016-10-07
    • 2019-12-23
    • 2021-01-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-14
    • 2016-04-12
    相关资源
    最近更新 更多