k-Nearest Neighbour Classification
ipredknn(formula, data, subset, na.action, k=5, ...)
formula |
a formula of the form |
data |
optional data frame containing the variables in the model formula. |
subset |
optional vector specifying a subset of observations to be used. |
na.action |
function which indicates what should happen when
the data contain |
k |
number of neighbours considered, defaults to 5. |
... |
additional parameters. |
An object of class ipredknn. See predict.ipredknn.
library("mlbench")
learn <- as.data.frame(mlbench.twonorm(300))
mypredict.knn <- function(object, newdata)
predict.ipredknn(object, newdata, type="class")
errorest(classes ~., data=learn, model=ipredknn,
predict=mypredict.knn)Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.