问题描述
获得以下二进制分类结果的数据点总数=1500.其中,我有
The total number of data points for which the following binary classification result is obtained = 1500. Out of which, I have
- 1473分别标记为
0
和 - 其余27个为
1
.
从混淆矩阵中可以看出,在属于类 1
的27个数据点中,我只有1个数据点被误分类为 0
.因此,我计算了各个类别的准确度,得出类别的准确度标记为0 = 98.2%,另一个类别的准确度标记为1.7333%.这个计算正确吗?我不确定...对于标记为 1
的类,我确实得到了很好的分类,那么为什么它的准确性低?每个班级的个人精度应该是100%,而班级1的准确率应该是98%左右
As can be seen from the confusion matrix, out of 27 data points belonging to class 1
, I got only 1 data point misclassified as 0
. So, I calculated the accuracy for individual classes and got Accuracy for class labelled as 0 = 98.2% and for the other as 1.7333%. Is this calculation correct? I am not sure...I did get a pretty good classification for the class labelled as 1
so why the accuracy for it is low?The individual class accuracies should have been 100% for class0 and around 98% for class1
一种分类错误会导致1类的准确性降低太多吗?这就是我如何在MAtlab中计算各个班级的准确性.
Does one misclassification reduce the accuracy of class 1 by so much amount? This is the how I calculated the individual class accuracies in MAtlab.
cmMatrix =
1473 0
1 26
acc_class0 = 100*(cmMatrix(1,1))/1500;
acc_class1= 100*(cmMatrix(2,2))/1500;
推荐答案
如果所有内容均已正确分类,则您的计算将表明类别1的准确性为27/1500 = 0.018.这显然是错误的.总体精度为1499/1500,但每类精度不能使用1500作为分母.27是可正确分类的最大元素,因此应为分母.
If everything had been classified correctly, your computation would indicate accuracy for class 1 as 27/1500=0.018. This is obviously wrong. Overall accuracy is 1499/1500, but per-class accuracy cannot use 1500 as denominator. 27 is the maximum correctly classified elements, and should therefore be the denominator.
acc_class0 = 100*cmMatrix(1,1)/sum(cmMatrix(1,:));
acc_class1 = 100*cmMatrix(2,2)/sum(cmMatrix(2,:));
这篇关于个别班级准确性计算混乱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!