Skip to content
Back to formatted view

Raw Message

Message-ID: <3A822319EB35174CA3714066D590DCD50994E8AF@usrymx25.merck.com>
Date: 2005-03-21T16:22:08Z
From: Liaw, Andy
Subject: How to do knn regression

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 at 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
> 
> 
>