我试图用python创建一个混淆矩阵。但是,正如您在下图中看到的,我的类标签彼此不匹配。我基本上希望y轴从Tshirt/Top开始,以踝靴结束。这是我的代码:
test_labels = test_labels.argmax(axis=1)
predictions = predictions.argmax(axis=1)
cm = confusion_matrix(test_labels, predictions)
plt.setp(ax.xaxis.set_ticklabels(class_names), rotation=90, horizontalalignment='right')
plt.setp(ax.yaxis.set_ticklabels(class_names), rotation=360, horizontalalignment='right')
我是python新手,所以我不确定我做错了什么。在
在最后2行之前执行以下操作:
看起来倒过来的单子就可以了?在
相关问题 更多 >
编程相关推荐