Description Usage Arguments Value Examples
This function cauculated k-Nearest Neighbors Cross-Validation
1 | my_knn_cv(train, cl, k_nn, k_cv)
|
train |
A data frame to be calculated for knn Cross-Validation. |
cl |
A true class value of your data. |
k_nn |
An integer representing the number of neighbors. |
k_cv |
A integer representing the number of folds. |
A list with objects with vector of predicted class for observations and numeric with the cross-validation misclassification error.
1 2 3 | train <- my_gapminder[4]
cl <- unlist(my_gapminder[1])
my_knn_cv(train, cl, 5, 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.