Description Usage Arguments Value Examples
Predicts output class species using covariates bill_length_mm, bill_depth_mm, flipper_length_mm, and body_mass_g.
1 | my_knn_cv(train, cl, k_nn, k_cv)
|
train |
input data frame |
cl |
true class value of your training data |
k_nn |
integer representing the number of neighbors |
k_cv |
integer representing the number of folds |
list containing a vector of the predicted class for all observations, and a numberic with the cross-validation and misclassification error
1 2 | my_penguins <- na.omit(my_penguins)
my_knn_cv(my_penguins[,3:6], my_penguins$species, 1, 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.