predict.sknn {klaR}R Documentation

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

sknn, knn

Examples

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

[Package klaR version 1.7-3 Index]