Home The size of the generated confusion matrix using confusionmat function is not right, why?
 I am working on a traffic sign recognition code in MATLAB using Belgian Traffic Sign Dataset. This dataset can be found here. The dataset consists of training data and test data (or evaluation data). I resized the given images and extracted HOG features using the VL_HOG function from VL_feat library. Then, I trained a multi class SVM using all of the signs inside the training dataset. There are 62 categories (i.e. different types of traffic signs) and 4577 frames inside the training set. I used the fitcecoc function to obtain the classifier. Upon training the multi-class SVM, I want to test the classifier performance using the test data and I used the predict and confusionmat functions, respectively. For some reason, the size of the returned confusion matrix is 53 by 53 instead of 62 by 62. Why the size of the confusion matrix is not the same as the number of categories? Thanks. -----Edit----- I found the issue some of the folders inside the testing dataset are empty, causing MATLAB skip those rows in the confusion matrix.