Description Usage Arguments Value Examples
Predicts an output class of a given training data using the k-Nearest Neighbors non-parametric statistical prediction method and cross-validation.
1 | my_knn_cv(train, cl, k_nn, k_cv)
|
train |
Data frame of numeric and string values intended as training data (with no NA values). |
cl |
The true class value of the training data, |
k_nn |
Numeric value representing the number of neighbors. |
k_cv |
Numeric value representing the number of folds for cross-validation. |
List containing predicted class (y-hat) for all observations in train
, and a numeric
value representing the cross-validation misclassification error.
1 2 | ex_penguins <- na.omit(my_penguins)
my_knn_cv(train = ex_penguins[,c(3:6)], cl = ex_penguins$species, k_nn = 1, k_cv = 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.