【发布时间】:2021-04-28 23:13:12
【问题描述】:
from sklearn.metrics import classification_report
y_true = [0, 1, 2, 2, 2]
y_pred = [0, 0, 2, 2, 1]
target_names = ['class 0', 'class 1', 'class 2']
print(classification_report(y_true, y_pred, target_names=target_names))
precision recall f1-score support
class 0 0.50 1.00 0.67 1
**class 1 0.00 0.00 0.00 1**
class 2 1.00 0.67 0.80 3
avg / total 0.70 0.60 0.61 5
为什么 class1 在所有情况下的得分都是 0.0,即使它有支持!以及为什么它没有涉及 int 预测
【问题讨论】:
-
你读过this吗?
标签: python machine-learning scikit-learn text-classification