MATLAB: Why knn classifier accuracy for multi class dataset is low

accuracyknnStatistics and Machine Learning Toolboxtestingtraining

I have data set consist of 296 features for 37 class. The data set is ordered according to the classes. I trained and test the data using KNN classifier. However, the maximum accuracy that i have go is about 13.423%.
  • why I got these low result I tried it on 296*21 features and 296*82 the result does not change much?
  • Is this because I have 37 class, because most of the application i saw have about 3 classes?
  • Is there any way to increase this accuracy or alternative evaluation way because the knn match result is success 100% ?
thank you

Best Answer

Your classes, using the features/measurements you chose to use, are badly overlapped. If you were able to plot each data point in 296-space, you'd see that there is a lot of mixing of where the classes occur.
For example, in 1-space if you had 5 classes
class1 = rand(1,100); % Ranges from 0 to 1.0
class2 = 1.05 * rand(1,100); % Ranges from 0 to 1.05
class3 = 1.10 * rand(1,100); % Ranges from 0 to 1.10
class4 = 1.15 * rand(1,100); % Ranges from 0 to 1.15
class5 = 1.20 * rand(1,100); % Ranges from 0 to 1.20
If you plotted each class in a different color, you'd see that there is a tremendous amount of overlap in the 0 to 1 region because all classes have a value in that region.