我正在使用sklearn中的F1_score指标。对于一些训练数据集,y=1(罕见情况)的总数为零,F1_score为零,这是正常的。但是sklearn会给出以下警告:
"UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 due to no predicted samples".
有人知道如何消除这个警告吗?通常情况下,我们能否消除sklearn中所有类型的警告?
"UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 due to no predicted samples".
有人知道如何消除这个警告吗?通常情况下,我们能否消除sklearn中所有类型的警告?