【问题标题】:Is it possible to calculate accuracy and ROC-AUC score at the same time with GridSearchCV?是否可以使用 GridSearchCV 同时计算准确率和 ROC-AUC 分数?
【发布时间】:2019-11-03 20:30:44
【问题描述】:
rf = RandomForestClassifier(random_state=0)
parameters = {'bootstrap': [True, False], 'min_samples_split':[2,3,4], 
'criterion':['entropy', 'gini'], 'n_estimators':[100, 200]             }
grid_search = GridSearchCV(estimator=rf, param_grid=parameters, 
scoring='accuracy', cv=10, n_jobs=-1)

我的代码目前使用GridSearchCV 执行网格搜索,根据预测的准确性对预测进行评分。如何在不使用 for 循环的情况下计算 ROC-AUC 分数?

【问题讨论】:

    标签: python pandas numpy cross-validation grid-search


    【解决方案1】:

    根据docs,您可以传递list 的字符串。在这种特定情况下,scoring=['accuracy', 'roc_auc'] 将是您想要的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-04-14
      • 2019-09-10
      • 2018-04-16
      • 2016-01-23
      • 2017-11-12
      • 1970-01-01
      • 2021-06-12
      • 2021-09-06
      相关资源
      最近更新 更多