Displaying 1 result from an estimated 1 matches for "max_ties".
Did you mean:
max_tries
2011 Sep 08
1
error in knn: too many ties in knn
Hello.
I found the behavior of knn(
http://stat.ethz.ch/R-manual/R-devel/library/class/html/knn.html) function
looking very strange.
Consider the toy example.
> library(class)
> train <- matrix(nrow=5000,ncol=2,data=rnorm(10000,0,1))
> test <- matrix(nrow=10,ncol=2,data=rnorm(20,0,1))
> cl <- rep(c(0,1),2500)
> knn(train,test,cl,1)
[1] 1 1 0 0 1 0 1 1 0 1
Levels: 0 1
It