【发布时间】:2018-10-13 21:56:56
【问题描述】:
我正在使用 sklearn.metrics.classification_report 来评估我的分类结果。
y_pred = np.argmax(model.predict(X_test), axis=1)
y_true = np.argmax(y_test, axis=1)
print(classification_report(y_true, y_pred, target_names=list(le.classes_)))
这是我的结果:
precision recall f1-score support
Technology 0.00 0.00 0.00 1
Travel 0.00 0.00 0.00 5
Fashion 0.00 0.00 0.00 25
Entertainment 0.72 1.00 0.84 130
Art 0.00 0.00 0.00 7
Politic 0.00 0.00 0.00 12
avg / total 0.52 0.72 0.61 180
问题实际上是我有 7 个标签。顺序是科技、旅游、时尚、娱乐、艺术、政治、体育。实际上,我的 y_true 结果中没有任何艺术标签,但报告按顺序列出,它列出了艺术,但跳过了运动。它写政治为艺术的结果,体育的结果进入政治的行。
为什么它不跳过艺术?我不知道我该如何解决这个问题。
【问题讨论】:
标签: python scikit-learn classification text-classification multiclass-classification