【发布时间】:2021-10-31 09:51:55
【问题描述】:
我不知道标题中是否明确,但我想打印一个classification_report。
我想写它属于Test set,就像这样:
print(f'Test classification report :{classification_report(y_test, y_pred)}')
但它给出的输出是 4 列名称移位:
Test classification report : precision recall f1-score support
0 0.68 0.50 0.57 187
1 0.79 0.89 0.84 407
accuracy 0.77 594
macro avg 0.74 0.69 0.71 594
weighted avg 0.76 0.77 0.76 594
谢谢
【问题讨论】:
-
print(f'Test classification report :\nclassification_report(y_test, y_pred)}')- 注意\n- 将在新行上打印标题。这就是你想要的吗? -
@tdelaney 好的,谢谢!
标签: python pandas numpy scikit-learn metrics