workflow_map: Process a series of workflows

View source: R/workflow_map.R

workflow_mapR Documentation

Process a series of workflows

Description

workflow_map() will execute the same function across the workflows in the set. The various tune_*() functions can be used as well as tune::fit_resamples().

Usage

workflow_map(
  object,
  fn = "tune_grid",
  verbose = FALSE,
  seed = sample.int(10^4, 1),
  ...
)

Arguments

object

A workflow set.

fn

The function to run. Acceptable values are: tune::tune_grid(), tune::tune_bayes(), tune::fit_resamples(), finetune::tune_race_anova(), finetune::tune_race_win_loss(), or finetune::tune_sim_anneal().

verbose

A logical for logging progress.

seed

A single integer that is set prior to each function execution.

...

Options to pass to the modeling function. See details below.

Details

When passing options, anything passed in the ... will be combined with any values in the option column. The values in ... will override that column's values and the new options are added to the options column.

Any failures in execution result in the corresponding row of results to contain a try-error object.

In cases where a model has no tuning parameters is mapped to one of the tuning functions, tune::fit_resamples() will be used instead and a warning is issued if verbose = TRUE.

If a workflow required packages that are not installed, a message is printed and workflow_map() continues with the next workflow (if any).

Value

An updated workflow set. The option column will be updated with any options for the tune package functions given to workflow_map(). Also, the results will be added to the result column. If the computations for a workflow fail, an try-catch object will be saved in place of the results (without stopping execution).

See Also

workflow_set(), as_workflow_set(), extract_workflow_set_result()

Examples

# An example of processed results
chi_features_res

# Code examples at
if (interactive()) {
  system.file("example-data", package = "workflowsets")
}

workflowsets documentation built on July 13, 2022, 1:05 a.m.