模糊矩阵(confusion_matrix )是由预测值和标签值构成的二维矩阵,共n行n列。 n表示类class的数量。
二分类
图为https://blog.csdn.net/orange _ spotty _ cat/article/details/80520839
多分类
#计算overallaccuracyoa=NP.diag (conf _ mat ).sum )/conf_mat.sum ) #计算每个类别的accuracyACC_cls=NP.aidg ) conf at 计算各类别的precision和recall precision _ cls=NP.diag (conf _ mat )/conf _ mat.sum (axis=1) recall conf _ mat.sum ()