[R] How to do knn regression

Menghui Chen menghui at gmail.com
Mon Mar 21 17:17:16 CET 2005


How can I do a simple k nearest neighbor regression in R? My training
data have 1 predictor and 1 outcome, both are numeric. I also need to
use FPE and SC to find the optimal model. I know there is knn() in
class package, but it's for knn classification. I also find a kknn
package. What function should I use?

Thanks in advance!

Menghui




More information about the R-help mailing list