0

If i classify data in 5 class, I get confusion matrix in 5 class classification but I can not calculate it

 4822  18   9     0     40
 0     1106 0     0     0
 0     2    1990  0     0
 0     0    1    2000   0
 0     0    0    0      12

Can I calculate TP, TN, FPR and FNR in multiclass problem?

Thank you!

PTZ
  • 11
  • 2

2 Answers2

-1

You can calculate these values per class and then aggregate them if you wish to do so. In the calculation for one class you treat the class as the "true" and the union of the other classes as "false". To aggregate for an overall value I would suggest to use the median, which is less sensitive to outliers.

-1

Yes, you can calculate these metrics by using the following steps:- 1- Convert your matrix to 2 x 2 matrix as below a. suppose your first class is A and second class is B for the new 2 x 2 matrix b. the new 2 x2 matrix should be like this

       Predicted Class 
       A        B
A     4822     67        // 67 comes from the summation of 18+9+0+40
B     0       5111       // 0 comes from the summation of 0+0+0+0 under 4822
                        // 5111 comes from the summation of the remaining numbers

2- Calculate the TP, TN, FP and FN rates using the equations in this URL page: http://www2.cs.uregina.ca/~dbd/cs831/notes/confusion_matrix/confusion_matrix.html