UndefinedMetricWarning:y_true 中没有正样本,真正的正值应该是无意义的 UndefinedMetricWarning)

pie*_*rre 5 python scikit-learn

我收到了这个警告

UndefinedMetricWarning:y_true 中没有正样本,真正的正值应该是无意义的 UndefinedMetricWarning)

你知道这意味着什么吗?

Ven*_*lam 7

这意味着 y_true 中的所有值均为零,这意味着给定数据集中没有正类记录。

尝试以下操作来了解数据集中类的分布。

from collections import Counter
Counter(y_true) # y_true must be your labels
Run Code Online (Sandbox Code Playgroud)