my_knn_cv: my k-Nearest Neighbors Cross-Validation function

Description Usage Arguments Value Examples

View source: R/my_knn_cv.R

Description

This function performs a k-Nearest Neighbors Cross-Validation in R.

Usage

1
my_knn_cv(train, cl, k_nn, k_cv)

Arguments

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

Value

a list with objects: class, a vector of the predicted class yi_hat for all observations; cv_err, a numeric with the cross-validation misclassification error.

Examples

1

atlasyao/happypackage documentation built on March 23, 2020, 5:23 a.m.