Builds a tidymodels workflow based on an input model and recipe.
buildWflow(parsnip_mod, recipe)A parsnip model object, such as the output of
buildLRModel() (random forest and boosted tree support planned)
A recipe, such as the output of buildRecipe()
A workflow object
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
#>