asp网站源码,一个门户网站怎么做,怎样做一个小程序,模板app混淆矩阵Confusion matrix#xff1a;也称为误差矩阵#xff0c;通过计算得出矩阵的结果用来表示分类器的精度。其每一列代表预测值#xff0c;每一行代表的是实际的类别。 from sklearn.metrics import confusion_matrixy_true [2, 0, 2, 2, 0, 1]
y_pred [0, 0, 2, 2, 0… 混淆矩阵Confusion matrix也称为误差矩阵通过计算得出矩阵的结果用来表示分类器的精度。其每一列代表预测值每一行代表的是实际的类别。 from sklearn.metrics import confusion_matrixy_true [2, 0, 2, 2, 0, 1]
y_pred [0, 0, 2, 2, 0, 2]
cconfusion_matrix(y_true, y_pred)
print(c)
结果 [[2 0 0] [0 0 1] [1 0 2]]
对这个矩阵的理解画了图 参数 normalize 可选值有{true, pred, all} The parameter normalize allows to report ratios instead of counts. 这个参数值可以使用百分率来代替个数。true,pred,all 分别表示以每行每列所有元素和为整体整体占有率为1