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

predict.ipredknn

Predictions from k-Nearest Neighbors


Description

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

Usage

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

Arguments

object

object of class ipredknn.

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 ipredknn. For the details see knn.

Value

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


ipred

Improved Predictors

v0.9-11
GPL (>= 2)
Authors
Andrea Peters [aut], Torsten Hothorn [aut, cre], Brian D. Ripley [ctb], Terry Therneau [ctb], Beth Atkinson [ctb]
Initial release
2021-03-12

We don't support your browser anymore

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