cv_tree: Cross-validation for regression trees

View source: R/cv_tree.r

cv_treeR Documentation

Cross-validation for regression trees

Description

Cross-validation for regression trees

Usage

cv_tree(formula, data, ..., nfolds = 10, seed, p = seq(0.01, 0.2, 0.01))

## S3 method for class 'cv_tree'
plot(x, rev = FALSE, ...)

Arguments

formula

Model formula, as in ctree()

data

Data frame containing the variables in the model, as in ctree()

...

Additional arguments to ctree()

nfolds

Number of cross-validation folds. Default: 10.

seed

Seed for reproducibility

p

Complexity parameter; see mincriterion in ctree_control()

x

Result of a call to

rev

Reverse horizontal axis (i.e., plot from high-to-low complexity)? Defualt: FALSE.

Examples

cv <- cv_tree(mpg ~ ., mtcars)
plot(cv)


pbreheny/breheny documentation built on April 26, 2024, 10:40 a.m.