powered by
Classifies new observations using the sknn learned by the sknn-function.
sknn
# 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’.
class
posterior
sknn, knn
knn
# NOT RUN { data(iris) x <- sknn(Species ~ ., data = iris) predict(x, iris) x <- sknn(Species ~ ., gamma = 10, kn = 10, data = iris) predict(x, iris) # }
Run the code above in your browser using DataLab