This object has the results when a bagged regression tree was resampled using 10-fold cross-validation.
The code used to produce this object:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | library(tidymodels)
library(baguette)
tidymodels_prefer()
# ------------------------------------------------------------------------------
ctrl_rs <- control_resamples(save_pred = TRUE)
# ------------------------------------------------------------------------------
set.seed(1)
cars_rs <- vfold_cv(mtcars)
cars_bag_vfld <-
bag_tree() %>%
set_engine("rpart", times = 5) %>%
set_mode("regression") %>%
fit_resamples(
mpg ~ .,
resamples = cars_rs,
control = ctrl_rs
)
|
An object with primary class resample_results
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.