my_knn_cv: 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 on the given data.

Usage

1
my_knn_cv(train, cl, k_nn, k_cv)

Arguments

train

An input data frame.

cl

A true class value of train.

k_nn

An integer representing the number of neighbors.

k_cv

An integer representing the number of folds.

Value

A list containing a vector set of the predicted class for all the observatoin and a number representing the cross-validation misclassification error.

Examples

1

Zhaoyu-Andrew/Rpackage documentation built on March 19, 2020, 4:55 p.m.