predict.sknn: Simple k Nearest Neighbours Classification

Description Usage Arguments Value Author(s) See Also Examples

View source: R/sknn.R

Description

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

Usage

1
2
## 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, [email protected]

See Also

sknn, knn

Examples

1
2
3
4
5
data(iris)
x <- sknn(Species ~ ., data = iris)
predict(x, iris)
x <- sknn(Species ~ ., gamma = 10, kn = 10, data = iris)
predict(x, iris)

klaR documentation built on March 19, 2018, 5:03 p.m.