Description Usage Examples
View source: R/myknn.R
Using knn and return the fitted values.
1
myknn(X,Y)
1 2 3 4 5
train_sub=sample(nrow(iris),0.8*nrow(iris)) train_data=iris[train_sub,1:4] train_Y=iris[train_sub,5] test_data=iris[-train_sub,1:4] myknn(train_data,train_Y,test_data)
Add the following code to your website.
REMOVE THIS Copy to clipboard
For more information on customizing the embed code, read Embedding Snippets.