cv_tree | R Documentation |
Cross-validation for regression trees
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, ...)
formula |
Model formula, as in |
data |
Data frame containing the variables in the model, as in |
... |
Additional arguments to |
nfolds |
Number of cross-validation folds. Default: 10. |
seed |
Seed for reproducibility |
p |
Complexity parameter; see |
x |
Result of a call to |
rev |
Reverse horizontal axis (i.e., plot from high-to-low complexity)? Defualt: FALSE. |
cv <- cv_tree(mpg ~ ., mtcars)
plot(cv)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.