These functions are helpful for manipulating the information in the option column.

option_add(x, ..., id = NULL, strict = FALSE)

option_remove(x, ...)

option_add_parameters(x, id = NULL, strict = FALSE)

Arguments

x

A workflow set

...

A list of named options. For option_remove() this can be a series of unquoted option names.

id

A character string of one or more values from the wflow_id column that indicates which options to update. By default, all workflows are updated.

strict

A logical; show execution stop if existing options are being replaced?

Value

An updated workflow set.

Details

option_add() is used to update all of the options in a workflow set.

option_remove() will eliminate specific options across rows.

option_add_parameters() adds a parameter object to the option column (if parameters are being tuned).

Note that executing a function on the workflow set, such as tune_grid(), will add any options given to that function to the option column.

Examples

two_class_set %>% option_add(a = 1)
#> # A workflow set/tibble: 6 × 4 #> wflow_id info option result #> <chr> <list> <list> <list> #> 1 none_cart <tibble [1 × 4]> <opts[1]> <list [0]> #> 2 none_glm <tibble [1 × 4]> <opts[1]> <list [0]> #> 3 none_mars <tibble [1 × 4]> <opts[1]> <list [0]> #> 4 yj_trans_cart <tibble [1 × 4]> <opts[1]> <list [0]> #> 5 yj_trans_glm <tibble [1 × 4]> <opts[1]> <list [0]> #> 6 yj_trans_mars <tibble [1 × 4]> <opts[1]> <list [0]>
two_class_set %>% option_add(a = 1) %>% option_add(b = 2, id = "none_cart")
#> # A workflow set/tibble: 6 × 4 #> wflow_id info option result #> <chr> <list> <list> <list> #> 1 none_cart <tibble [1 × 4]> <opts[2]> <list [0]> #> 2 none_glm <tibble [1 × 4]> <opts[1]> <list [0]> #> 3 none_mars <tibble [1 × 4]> <opts[1]> <list [0]> #> 4 yj_trans_cart <tibble [1 × 4]> <opts[1]> <list [0]> #> 5 yj_trans_glm <tibble [1 × 4]> <opts[1]> <list [0]> #> 6 yj_trans_mars <tibble [1 × 4]> <opts[1]> <list [0]>
library(tune) two_class_set %>% option_add_parameters()
#> # A workflow set/tibble: 6 × 4 #> wflow_id info option result #> <chr> <list> <list> <list> #> 1 none_cart <tibble [1 × 4]> <opts[1]> <list [0]> #> 2 none_glm <tibble [1 × 4]> <opts[0]> <list [0]> #> 3 none_mars <tibble [1 × 4]> <opts[1]> <list [0]> #> 4 yj_trans_cart <tibble [1 × 4]> <opts[1]> <list [0]> #> 5 yj_trans_glm <tibble [1 × 4]> <opts[0]> <list [0]> #> 6 yj_trans_mars <tibble [1 × 4]> <opts[1]> <list [0]>