Builds a tidymodels workflow based on an input model and recipe.

buildWflow(parsnip_mod, recipe)

Arguments

parsnip_mod

A parsnip model object, such as the output of buildLRModel() (random forest and boosted tree support planned)

recipe

A recipe, such as the output of buildRecipe()

Value

A workflow object

Examples

train <- tibble::tibble(
  genome_id = paste0("g", 1:10),
  genome_drug.resistant_phenotype = rep(c("Resistant", "Susceptible"), each = 5),
  feat_a = rep(c(0L, 1L), 5),
  feat_b = rep(c(1L, 0L), 5)
)
rec <- buildRecipe(train, use_pca = FALSE)
lr <- buildLRModel()
buildWflow(lr, rec)
#> ══ Workflow ════════════════════════════════════════════════════════════════════
#> Preprocessor: Recipe
#> Model: logistic_reg()
#> 
#> ── Preprocessor ────────────────────────────────────────────────────────────────
#> 2 Recipe Steps
#> 
#> • step_zv()
#> • step_normalize()
#> 
#> ── Model ───────────────────────────────────────────────────────────────────────
#> Logistic Regression Model Specification (classification)
#> 
#> Main Arguments:
#>   penalty = hardhat::tune()
#>   mixture = hardhat::tune()
#> 
#> Computational engine: glmnet 
#>