11.2 Calculate performance statistics: {workflowsets}
We’ll take a closer look at this, but workflowsets makes this stuff way cleaner!
<- workflowsets::workflow_set(
lm_models preproc = list(
basic = basic_recipe,
interact = interaction_recipe,
splines = spline_recipe
),models = list(lm = lm_model),
cross = FALSE
%>%
) ::workflow_map(
workflowsetsfn = "fit_resamples",
# Options to `workflow_map()`:
seed = 1101, verbose = TRUE,
# Options to `fit_resamples()`:
resamples = ames_folds, control = keep_pred
)
collect_metrics(lm_models) %>%
filter(.metric == "rsq")