my_knn_cv: K-nearest Neighbors function

Description Usage Arguments Value Examples

View source: R/my_knn_cv.R

Description

This function uses k-nearest neighbour classification for test set from training set.

Usage

1
my_knn_cv(train, cl, k_nn, k_cv)

Arguments

train

the training data set

cl

factor of true classifications of training set

k_nn

number of neighbours considered

k_cv

integer representing the number of folds

Value

a list with a vector of the predicted class and a numeric with the cross-validation misclassification rate a numeric with the training misclassification rate

Examples

1
my_knn_cv(my_iris[, -5], my_iris$Species, 1, 5)

Xiaoying-Z/Stat302Project03 documentation built on March 22, 2020, 2:09 a.m.