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

predict.sknn

Simple k Nearest Neighbours Classification


Description

Classifies new observations using the sknn learned by the sknn-function.

Usage

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

Arguments

object

Object of class sknn.

newdata

Data frame (or matrix) of cases to be classified.

...

...

Value

A list with elements ‘class’ and ‘posterior’.

Author(s)

Karsten Luebke, karsten.luebke@fom.de

See Also

Examples

data(iris)
x <- sknn(Species ~ ., data = iris)
predict(x, iris)
x <- sknn(Species ~ ., gamma = 10, kn = 10, data = iris)
predict(x, iris)

klaR

Classification and Visualization

v0.6-15
GPL-2 | GPL-3
Authors
Christian Roever, Nils Raabe, Karsten Luebke, Uwe Ligges, Gero Szepannek, Marc Zentgraf, David Meyer
Initial release
2020-02-18

We don't support your browser anymore

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