my_knn_cv: my_knn_cv function

Description Usage Arguments Value Examples

View source: R/my_knn_cv.R

Description

This function predict output class species using covariates bill_length_mm, bill_depth_mm, flipper_length_mm, and body_mass_g.

Usage

1
my_knn_cv(k_cv, train, cl, k_nn)

Arguments

k_cv

Integer representing the number of folds.

train

Input data frame.

cl

True class value of your training data.

k_nn

Integer representing the number of neighbors.

Value

a list with objects: class of speciese and CV error

Examples

1
2
train <- na.omit(my_penguins)
my_knn_cv(5, train[,3:6],train[[1]], 1)

eunicezh/STAT302package documentation built on Dec. 20, 2021, 6:43 a.m.