# ------------------------------------------------------------------------------
# Existing results
# Use the already worked example to show how to add tuned
# objects to a workflow set
two_class_res
results <- two_class_res %>% purrr::pluck("result")
names(results) <- two_class_res$wflow_id
# These are all objects that have been resampled or tuned:
purrr::map_chr(results, ~ class(.x)[1])
# Use rlang's !!! operator to splice in the elements of the list
new_set <- as_workflow_set(!!!results)
# ------------------------------------------------------------------------------
# Make a set from unfit workflows
library(parsnip)
library(workflows)
lr_spec <- logistic_reg()
main_effects <-
workflow() %>%
add_model(lr_spec) %>%
add_formula(Class ~ .)
interactions <-
workflow() %>%
add_model(lr_spec) %>%
add_formula(Class ~ (.)^2)
as_workflow_set(main = main_effects, int = interactions)
Run the code above in your browser using DataLab