Description Usage Arguments Details Value Author(s) Examples
$k$-nearest neighbour regression that can return the average value for the neighbours.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
formula |
a formula of the form |
data |
optional data frame containing the variables in the model formula. |
subset |
optional vector specifying a subset of observations to be used. |
na.action |
function which indicates what should happen when
the data contain |
k |
number of neighbours considered. |
x |
a matrix or data frame of training set predictors. |
y |
a numeric vector of outcomes. |
... |
additional parameters to pass to |
train |
matrix or data frame of training set cases. |
test |
matrix or data frame of test set cases. A vector will be interpreted as a row vector for a single case. |
use.all |
controls handling of ties. If true, all distances equal to the |
knnreg
is similar to ipredknn
and knnregTrain
is a modification of knn
. The underlying
C code from the class
package has been modified to return average outcome.
An object of class knnreg
. See predict.knnreg
.
knn
by W. N. Venables and B. D. Ripley and
ipredknn
by
Torsten.Hothorn <Torsten.Hothorn@rzmail.uni-erlangen.de>,
modifications by Max Kuhn and Chris Keefer
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Loading required package: lattice
Loading required package: ggplot2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.