cat", "ant", "cat"] #预测
y_true=["cat", "ant", "cat", "cat", "ant", "bird"] #真实
下图便是上面给出数据的混淆矩阵,数轴的标签表示真实属性...,而横轴的标签表示分类的预测结果。...pd.DataFrame(C,index=["ant", "bird", "cat"],columns=["ant", "bird", "cat"])
sns.heatmap(df,annot=True)
另外一种是使用matplotlib...的matshow来绘制。...plt.matshow(C, cmap=plt.cm.Greens)
plt.colorbar()
for i in range(len(C)):
for j in range(len(C)):