my_rf_cv: random forest function

Description Usage Arguments Value Examples

View source: R/my_rf_cv.R

Description

This function performs random forest algorithm with k-fold cross validation.

Usage

1
my_rf_cv(train, k_cv)

Arguments

train

input data frame

k_cv

integer representing the number of folds

Value

a numeric with the cross-validation error

Examples

1
2
3
dat <- na.omit(my_penguins[, c("body_mass_g", "bill_length_mm",
                               "bill_depth_mm", "flipper_length_mm")])
my_rf_cv(dat, 2)

RuofengT/stat302package documentation built on Dec. 18, 2021, 11:54 a.m.