powered by
This function predicts values based upon a model trained by KNN.
KNN
# S3 method for knn predict(object, test, fuzzy = FALSE, ...)
A vector of predicted values (factor).
factor
The classification model (of class knn).
knn
The test set (a data.frame).
data.frame
A boolean indicating whether fuzzy classification is used or not.
Other parameters.
KNN, knn-class
knn-class
require (datasets) data (iris) d = splitdata (iris, 5) model = KNN (d$train.x, d$train.y) predict (model, d$test.x)
Run the code above in your browser using DataLab