Description Usage Arguments Value Examples
This function predicts the output class from a given set of covariates and actual class values using the k-nearest neighbors approach of identifying patterns in data points near each other.
1 | my_knn_cv(train, cl, k_nn, k_cv)
|
train |
An input data frame with all the values of the predictor variables. |
cl |
The (actual) response values corresponding to each of the values
from |
k_nn |
A numeric integer representing the number of neighbors considered. |
k_cv |
A numeric integer representing the number of folds for which to
divide the observations in |
A list with elements class
and cv_err
, where
class
is a vector of the predicted classes for all
observations, and cv_err
is a numeric with the cross-validation
misclassification error.
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.