View source: R/boundary_workflow_set.R
| boundary_workflow_set | R Documentation |
A dedicated helper to automatically fit and extract classification boundaries
for an entire workflow_set. This avoids the need for manual iteration over models.
boundary_workflow_set(
wf_set,
data,
feature_range = NULL,
response,
resolution = 100,
...
)
wf_set |
A |
data |
A data frame containing the training data. This is required to extract feature metadata and to fit any workflows that are not yet trained. |
feature_range |
An optional named list specifying the minimum and maximum values for each feature,
or a character vector of feature names. If |
response |
A string specifying the name of the response column in |
resolution |
An integer specifying the number of points along each axis (default = 100). |
... |
Additional arguments passed to |
A data frame containing the combined boundary grid for all models, with a model column
indicating the wflow_id.
library(palmerpenguins)
library(workflowsets)
library(parsnip)
data(penguins)
peng_data <- na.omit(penguins[, c("species", "bill_length_mm", "bill_depth_mm")])
# Define multiple engines
spec_rpart <- decision_tree() |>
set_engine("rpart") |>
set_mode("classification")
spec_glm <- multinom_reg() |>
set_engine("nnet") |>
set_mode("classification")
# Create a workflow set
wf_set <- workflow_set(
preproc = list(base = species ~ bill_length_mm + bill_depth_mm),
models = list(tree = spec_rpart, log_reg = spec_glm)
)
# Compute 2D boundaries for all models simultaneously (auto-range)
bounds <- boundary_workflow_set(wf_set, peng_data, response = "species", resolution = 30)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.