[R] Fwd: Re: knn - random result although use.all=TRUE

2015-11-23 Thread itziar irigoien
Thank you very much for your prompt response. Now I see why the results have a random part: although all units with tied distances are included in the neighbourhood, the votes have to be broken at random. Thank you! Itziar Irigoien On or., 2015.eko azaren 20a 16:40, David L Carlson wrote

[R] knn - random result although use.all=TRUE

2015-11-19 Thread itziar irigoien
each time I apply it. Could anyone help me finding out what is going on? Thanks, Itziar Irigoien # Generate data n <- 40 n1 <- 16 n2 <- n-n1 cl <- rep(1:2, c(n1, n2)) set.seed(37) X1 <- sample(1:3, n, replace=TRUE, prob=rep(1/3, 3)) set.seed(36) aux1 <- sample(1:2, n1, replac