Skip to Content

predict.knn3 {caret}

Predictions from k-Nearest Neighbors
Package: 
caret
Version: 
6.0-24

Description

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

Usage

 
## S3 method for class 'knn3':
predict((object, newdata, type=c("prob", "class"), ...))

Arguments

object
object of class knn3.
newdata
a data frame of new observations.
type
return either the predicted class or the the proportion of the votes for the winning class.
...
additional arguments.

Details

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

Values

Either the predicted class or the the proportion of the votes for each class.

Author(s)

predict.ipredknn by Torsten.Hothorn

Documentation reproduced from package caret, version 6.0-24. License: GPL-2