Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predict.knnreg

Predictions from k-Nearest Neighbors Regression Model


Description

Predict the outcome of a new observation based on k-NN.

Usage

## S3 method for class 'knnreg'
predict(object, newdata, ...)

Arguments

object

object of class knnreg.

newdata

a data frame or matrix of new observations.

...

additional arguments.

Details

This function is a method for the generic function predict for class knnreg. For the details see knnreg. This is essentially a copy of predict.ipredknn.

Value

a numeric vector

Author(s)

Max Kuhn, Chris Keefer, adapted from knn and predict.ipredknn


caret

Classification and Regression Training

v6.0-86
GPL (>= 2)
Authors
Max Kuhn [aut, cre], Jed Wing [ctb], Steve Weston [ctb], Andre Williams [ctb], Chris Keefer [ctb], Allan Engelhardt [ctb], Tony Cooper [ctb], Zachary Mayer [ctb], Brenton Kenkel [ctb], R Core Team [ctb], Michael Benesty [ctb], Reynald Lescarbeau [ctb], Andrew Ziem [ctb], Luca Scrucca [ctb], Yuan Tang [ctb], Can Candan [ctb], Tyler Hunt [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.