Description Usage Arguments Value Examples
This function creates a knn model as well as calculating cross-validation and training errors
1 | my_knn_cv(train, cl, k_nn, k_cv)
|
train |
Data set to train model on. |
cl |
Vector of values for the true class. |
k_nn |
Numeric representing the number of neighbors to base model on. |
k_cv |
The number of folds to be used in the model. |
List containg vector of predicted classes, and numerics of the cross-validation and training errors.
1 2 3 | my_knn_cv(cbind(my_gapminder$gdpPercap, my_gapminder$lifeExp),
my_gapminder$continent, 10, 5)
my_knn_cv(my_iris[, -5], my_iris$Species, 2, 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.