【发布时间】:2021-10-02 03:00:00
【问题描述】:
我正在尝试绘制如下所示的混淆矩阵
cm = confusion_matrix(testY.argmax(axis=1), predictions.argmax(axis=1))
disp = ConfusionMatrixDisplay(confusion_matrix=cm, display_labels=lb.classes_)
disp = disp.plot(include_values=True, cmap='viridis', ax=None, xticks_rotation='horizontal')
plt.show()
结果:
如您所见,它显示的是框的轴,而不是框的轮廓。由于轴,我看不到黄色框外的数字。我不擅长情节。所以我不知道我需要改变什么。
我的期望:
找到解决方案
plt.tick_params(axis=u'both', which=u'both',length=0)
plt.grid(b=None)
【问题讨论】:
-
尝试使用sns plot,它很简单,写在matplotlib之上
标签: python scikit-learn confusion-matrix