## Not run:
# # examples of estimation procedures
# library(class)
# library(e1071)
#
# kNN <- function(data, formula, k) {
# df <- model.frame(formula=formula, data=data)
# function(newdata) {
# knn(train=df[, -1], test=newdata, cl=df[, 1], k=k)
# }
# }
#
# SVM <- function(data, formula, cost) {
# model <- svm(formula, data, cost=cost)
# function(newdata) {
# predict(model, newdata)
# }
# }
# ## End(Not run)
Run the code above in your browser using DataLab