Solved – SVM confusion matrix whose dimensions are more than two

classificationsvm

While I am using SVM, I train it with a train data and then I try to predict a sample if its label is -1 or +1. However, I see some confusion matrice for SVM like below. Mine are 2×2 matrice but their dimesions are larger, e.g. 15×15. Do they have more than one SVM? How people do such things? It is easy to write one diagonal but how they decide other values? In the figure below, for 2, it is easy to write 38 but how they write 2?

BTW, I am new to these topics.

15x15 confusion matrix

Best Answer

Based on only the context we can get from the URL name, they are most likely using 15 SVMs, each of which tries to classify one class "versus" the rest (one-vs-all). Thus you need 15, and thus 15x15 confusion matrix.

You make a good point - more than one of these might declare a new point as their own. What then? A simple way is to use the hyperplane that is output as the model for the SVM and compare the distance to the plane in all +1 class labelings and accept the class for which the distance from the point to the plane is the greatest (ie, was most confidently classified).

The off-trace (incorrect) labelings the classifier makes are still done in the same way, ie,

C_ij = count(we declared i, but was actually j)

Related Question