RE: [R] How to do knn regression

From: Liaw, Andy <andy_liaw_at_merck.com>
Date: Tue 22 Mar 2005 - 03:22:08 EST


ksmooth() will work for you, since you only have one predictor. There are better choices, though, such as loess().

Andy

> From: Menghui Chen
>
> 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
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
>
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Mar 22 03:26:06 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:51 EST