full_internal_make_wflw: Full Internal Workflow for Model and Recipe

View source: R/internals-full-make-wflw.R

full_internal_make_wflwR Documentation

Full Internal Workflow for Model and Recipe

Description

This function creates a full internal workflow for a model and recipe combination.

Usage

full_internal_make_wflw(.model_tbl, .rec_obj)

Arguments

.model_tbl

A model specification table (tidyaml_mod_spec_tbl).

.rec_obj

A recipe object.

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.

Value

The function returns a workflow object for the first model-recipe pair based on the internal function selected.

Author(s)

Steven P. Sanderson II, MPH

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


tidyAML documentation built on May 29, 2024, 4:07 a.m.