【发布时间】:2018-06-02 14:03:31
【问题描述】:
当我在 sklearn 上使用 GridSearchCV 时,它正在输出:
UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples
gridsearch 不是使用 StratifiedKFold 来进行交叉验证吗?不应该使用平衡批处理吗?
【问题讨论】:
当我在 sklearn 上使用 GridSearchCV 时,它正在输出:
UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples
gridsearch 不是使用 StratifiedKFold 来进行交叉验证吗?不应该使用平衡批处理吗?
【问题讨论】:
GridsearchCV 将使用StratifiedKFold,具体取决于y 是什么。来自docs
对于整数/无输入,如果估计器是分类器并且 y 是 使用二元或多类,StratifiedKFold。在所有其他 情况下,使用 KFold。
如果y 是多标签,则将使用KFold。
【讨论】: