my_knn_cv: k-Nearest Neighbors Cross-Validation Classification

Description Usage Arguments Value

View source: R/my_knn_cv.R

Description

k-nearest neighbor cross-validatory classification from training set.

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 for all observations, and cv_err, a numeric with the cross-validation misclassification error.


hugoliao330/stat302util documentation built on March 18, 2020, 12:12 a.m.