my_knn_cv: Output class predictor

Description Usage Arguments Value Examples

View source: R/my_knn_cv2.R

Description

This function predicts the species of penguins based on the input data.

Usage

1
my_knn_cv(train, cl, k_nn, k_cv)

Arguments

train

The data frame inputted.

cl

The true class of the training data.

k_nn

Numeric input representing the number of neighbors.

k_cv

Numeric input representing the number of folds.

Value

A list with a vector of predicted classes and a numeric value with the predicted misclassification rate.

Examples

1
2
 my_knn_cv(data_use, data_clean$species, k_nn = 1, k_cv = 5)
 

amakinney/Stat302Package documentation built on Dec. 19, 2021, 1:37 a.m.