I am trying to run rknn with rknn package but it appears an error I am not able to understand. Here's the code and the error:
rknn(bank_training, bank_testing, y_n, k=2, r=100, mtry=4)
Error in knn(train = data[, fset], test = newdata[, fset], cl = y, k = k, :
too many ties in knn
I tried to run it with different values of r from 10-500 but i get the same error and I don't understand what is meant with that. I ran it also as it is described in the manual (See below), but i get always the same error.
rknn(data, newdata, y, k = 1, r = 500, mtry = trunc(sqrt(ncol(data))),
Random.seed = NULL, seed = NULL, knn.algo="VR")
Does anyone have an idea why is that?
Thanks in advance!
class::knn(whichrknnseems to use if I read the code correctly)? In this case, you probably want to take a look at this R-help thread: error in knn: too many ties in knn. – chl♦ Jul 24 '12 at 14:27