I am trying to use the KNN algorithm from the class
package in R.
I have used it before on the same dataset, without normalizing one of the features, but it performed poor (0.35 precision). Now I tried to train the model with normalized features, but I get the error "too many ties in knn".
I am trying to predict user ratings on movies (using the Movie Lens data set).
I want to predict rating which could be 1,2,3,4,5. I tried with different values of k, which are not multiples of 5. I even tried with k = 1
, but I still get the same error.
The data consists mostly of binary attributes (19 genres of movies and gender of users) and only 1 numeric attribute (user age) and I think that is the problem.
Best Answer
Please combine the changes I've made below with the additional data that you have in your dataset which I don't have in the version I found, such as age, gender, etc.