library(class) library(leaps) fold.index <-cut(sample(1:nrow(train)), breaks=10, labels=FALSE) cv.error.best.fit <-rep(0,23) for(i in 1:23){# try different nu