Description Usage Arguments Value Examples
This function applies k-nearest neighbors cross validation to given data frame, true class, n nearest neighbors, and n folds
1 | my_knn_cv(train, cl, k_nn, k_cv)
|
train |
Dataframe containing the data used to predict |
cl |
Vector containing the true class |
k_nn |
Numeric indicating the number of neighbors |
k_cv |
Numeric indicating the number of folds |
List of predictions and cross validation error
1 2 3 | my_penguins <- na.omit(my_penguins)
my_knn_cv(my_penguins[, 3:6], my_penguins$species, 5, 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.