Full Internal Workflow for Model and Recipe
Source:R/internals-full-make-wflw.R
full_internal_make_wflw.Rd
This function creates a full internal workflow for a model and recipe combination.
Value
The function returns a workflow object for the first model-recipe pair based on the internal function selected.
Details
The function checks if the input model specification table inherits the class 'tidyaml_mod_spec_tbl'. It then manipulates the input table, making adjustments for factors and creating a list of grouped models. For each model-recipe pair, it uses the appropriate internal function based on the model type to create a workflow object. The specific internal function is selected using a switch statement based on the class of the model.
See also
Other Utility:
core_packages()
,
create_splits()
,
create_workflow_set()
,
fast_classification_parsnip_spec_tbl()
,
fast_regression_parsnip_spec_tbl()
,
install_deps()
,
load_deps()
,
match_args()
Examples
library(dplyr)
library(recipes)
rec_obj <- recipe(mpg ~ ., data = mtcars)
mod_tbl <- make_regression_base_tbl()
mod_tbl <- mod_tbl |>
filter(
.parsnip_engine %in% c("lm", "glm") &
.parsnip_fns == "linear_reg"
)
class(mod_tbl) <- c("tidyaml_mod_spec_tbl", class(mod_tbl))
mod_spec_tbl <- internal_make_spec_tbl(mod_tbl)
result <- full_internal_make_wflw(mod_spec_tbl, rec_obj)
result
#> [[1]]
#> ══ Workflow ════════════════════════════════════════════════════════════════════
#> Preprocessor: Recipe
#> Model: linear_reg()
#>
#> ── Preprocessor ────────────────────────────────────────────────────────────────
#> 0 Recipe Steps
#>
#> ── Model ───────────────────────────────────────────────────────────────────────
#> Linear Regression Model Specification (regression)
#>
#> Computational engine: lm
#>
#>
#> [[2]]
#> ══ Workflow ════════════════════════════════════════════════════════════════════
#> Preprocessor: Recipe
#> Model: linear_reg()
#>
#> ── Preprocessor ────────────────────────────────────────────────────────────────
#> 0 Recipe Steps
#>
#> ── Model ───────────────────────────────────────────────────────────────────────
#> Linear Regression Model Specification (regression)
#>
#> Computational engine: glm
#>
#>