GridSearchCV with Scoring Function and Refit Parameter

后端 未结 1 566
孤街浪徒
孤街浪徒 2021-01-24 15:37

My question seems to be similar to this one but there is no solid answer there.

I\'m doing a multi-class multi-label classification, and for doing that I have defined my

相关标签:
1条回答
  • 2021-01-24 16:20

    You should use refit="roc_auc_score", the name of the scorer in your dictionary. From the docs:

    For multiple metric evaluation, this needs to be a str denoting the scorer that would be used to find the best parameters for refitting the estimator at the end.

    Using a callable for refit has a different purpose: the callable should take the cv_results_ dict and return the best_index_. That explains the error message: sklearn is trying to pass cv_results_ to your auc scorer function, but that function should take parameters y_true and y_pred.

    0 讨论(0)
提交回复
热议问题