首页 > 其他 > 详细

Confusion matrix

时间:2021-05-19 17:02:01      阅读:22      评论:0      收藏:0      [点我收藏+]

import matplotlib.pyplot as plt
import seaborn as sns
from sklearn import metrics

y_true = [0, 1, 2, 0, 1, 2, 0, 2, 2]
y_pred = [0, 2, 1, 0, 2, 1, 0, 0, 2]

cm = metrics.confusion_matrix(y_true, y_pred)

plt.figure(figsize=(10, 10))
cmap = sns.cubehelix_palette(50, hue=0.05, rot=0, light=0.9, dark=0,
as_cmap=True)
sns.set(font_scale=2.5)
sns.heatmap(cm, annot=True, cmap=cmap, cbar=False)
plt.ylabel(‘Actual Labels‘, fontsize=20)
plt.xlabel(‘Predicted Labels‘, fontsize=20)

技术分享图片

 

Confusion matrix

原文:https://www.cnblogs.com/songyuejie/p/14784736.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!