Learn R Programming

workflowsets (version 1.1.0)

extract_workflow_set_result: Extract elements of workflow sets

Description

These functions extract various elements from a workflow set object. If they do not exist yet, an error is thrown.

  • extract_preprocessor() returns the formula, recipe, or variable expressions used for preprocessing.

  • extract_spec_parsnip() returns the parsnip model specification.

  • extract_fit_parsnip() returns the parsnip model fit object.

  • extract_fit_engine() returns the engine specific fit embedded within a parsnip model fit. For example, when using parsnip::linear_reg() with the "lm" engine, this returns the underlying lm object.

  • extract_mold() returns the preprocessed "mold" object returned from hardhat::mold(). It contains information about the preprocessing, including either the prepped recipe, the formula terms object, or variable selectors.

  • extract_recipe() returns the recipe. The estimated argument specifies whether the fitted or original recipe is returned.

  • extract_workflow_set_result() returns the results of workflow_map() for a particular workflow.

  • extract_workflow() returns the workflow object. The workflow will not have been estimated.

  • extract_parameter_set_dials() returns the parameter set that will be used to fit the supplied row id of the workflow set. Note that workflow sets reference a parameter set associated with the workflow contained in the info column by default, but can be fitted with a modified parameter set via the option_add() interface. This extractor returns the latter, if it exists, and returns the former if not, mirroring the process that workflow_map() follows to provide tuning functions a parameter set.

  • extract_parameter_dials() returns the parameters object that will be used to fit the supplied tuning parameter in the supplied row id of the workflow set. See the above notes in extract_parameter_set_dials() on precedence.

Usage

extract_workflow_set_result(x, id, ...)

# S3 method for workflow_set extract_workflow(x, id, ...)

# S3 method for workflow_set extract_spec_parsnip(x, id, ...)

# S3 method for workflow_set extract_recipe(x, id, ..., estimated = TRUE)

# S3 method for workflow_set extract_fit_parsnip(x, id, ...)

# S3 method for workflow_set extract_fit_engine(x, id, ...)

# S3 method for workflow_set extract_mold(x, id, ...)

# S3 method for workflow_set extract_preprocessor(x, id, ...)

# S3 method for workflow_set extract_parameter_set_dials(x, id, ...)

# S3 method for workflow_set extract_parameter_dials(x, id, parameter, ...)

Value

The extracted value from the object, x, as described in the description section.

Arguments

x

A workflow set outputted by workflow_set() or workflow_map().

id

A single character string for a workflow ID.

...

Other options (not currently used).

estimated

A logical for whether the original (unfit) recipe or the fitted recipe should be returned.

parameter

A single string for the parameter ID.

Details

These functions supersede the pull_*() functions (e.g., extract_workflow_set_result()).

Examples

Run this code
library(tune)

two_class_res

extract_workflow_set_result(two_class_res, "none_cart")

extract_workflow(two_class_res, "none_cart")

Run the code above in your browser using DataLab