Description Usage Arguments Value Examples
This function randomly splits data into k "folds" and predicts class using covariates.
1 | my_knn_cv(train, cl, k_nn, k_cv)
|
train |
A data frame of the covariates (elements are numeric). |
cl |
True class value of the training data. |
k_nn |
Integer of the number of neighbors. |
k_cv |
Integer of the number of folds. |
A list containing:
class
, a vector of the predicted class.
CV_error
, a numeric of the average cross-validation
misclassification error rate.
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.