Question

I am trying to perform 10 fold cross validation for analysing the results of my character recognition project using neural networks in matlab. I know how to calculate the confusion matrix for each fold. But the problem is i dont know how to calculate the confusion matrix averaged over the 10 folds.

Was it helpful?

Solution

If you have the confusion matrices for each fold, you can simply sum their values to get the total confusion matrix.

For example, if you had two folds,and the resulting confusion matrices were

                     Classifier
                 -----------------
                 Class 1   Class 2
Actual | Class 1      25         3
       | Class 2       6        21

                     Classifier
                 -----------------
                 Class 1   Class 2
Actual | Class 1      23         5
       | Class 2       4        23

Then the total confusion matrix is

                     Classifier
                 -----------------
                 Class 1   Class 2
Actual | Class 1      48         8
       | Class 2      10        44
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top