Description Usage Arguments Value Examples
This function predicts output class using covariates.
1 | my_knn_cv(train, cl, k_nn, k_cv)
|
train |
Dataframe to be inputted |
cl |
Class value of training data |
k_nn |
Integer represemmting number of neighbors |
k_cv |
Integer representing the number of folds |
a list with objects class and cv_err. Class is a vector of predicted class. CV_err is a numeric with cross-validation misclassification error
1 2 3 4 5 | penguins <- mypackage::my_penguins
data <- penguins %>% tidyr::drop_na()
train <- data[3:6]
cl <- data$species
my_knn_cv(train, cl, 1, 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.