I am trying to do knn classification using knncat in R since I have categorical attributes in my data set.
knncat(FinalData, FinalTestData, k=10, classcol = 15)
when i execute the above statement, it gives me the error that : Sets of levels in train and test do not match.
On checking of levels for all of the attributes, i did get a difference. I have a country attribute which can take from 1-41 values in train data set.
However in test data set, one particular country never appears and thus it is causing this error. How am I supposed to deal with that ?