Classifies new observations using the sknn learned by
the sknn
-function.
# S3 method for sknn
predict(object, newdata,...)
Object of class sknn
.
Data frame (or matrix) of cases to be classified.
…
A list with elements ‘class
’ and ‘posterior
’.
# NOT RUN { data(iris) x <- sknn(Species ~ ., data = iris) predict(x, iris) x <- sknn(Species ~ ., gamma = 10, kn = 10, data = iris) predict(x, iris) # }