predict.knn | R Documentation |
This function predicts values based upon a model trained by KNN
.
## S3 method for class 'knn'
predict(object, test, fuzzy = FALSE, ...)
object |
The classification model (of class |
test |
The test set (a |
fuzzy |
A boolean indicating whether fuzzy classification is used or not. |
... |
Other parameters. |
A vector of predicted values (factor
).
KNN
, knn-class
require (datasets)
data (iris)
d = splitdata (iris, 5)
model = KNN (d$train.x, d$train.y)
predict (model, d$test.x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.