Customized Version of {workflowsets}
rpwf_workflow_set.Rd
Wrapper around tidyr::crossing()
that creates all combinations of recipes
and models.
Arguments
- preprocs
list or vector of
recipes::recipe()
.- models
list or vector of model spec. Generated by adding
set_py_engine()
to a model, e.g.parsnip::boost_tree()
andparsnip::set_engine()
.- costs
list or vector of sklearn cost optimization metrics such as "neg_log_loss" and "roc_auc". Check the docs for available values.
Examples
d <- mtcars
d$id <- seq_len(nrow(d))
m1 <- parsnip::boost_tree() |>
parsnip::set_engine("xgboost") |>
parsnip::set_mode("classification") |>
set_py_engine(py_module = "xgboost", py_base_learner = "XGBClassifier")
r1 <- d |>
recipes::recipe(vs ~ .) |>
# "pd.index" is the special column that used for indexing in pandas
recipes::update_role(id, new_role = "pd.index")
wf <- rpwf_workflow_set(list(r1), list(m1), "neg_log_loss")
wf
#> # A tibble: 1 × 3
#> preprocs models costs
#> * <list> <list> <chr>
#> 1 <recipe> <spec[+]> neg_log_loss