tune (version 0.1.2)

tunable.model_spec: Find recommended methods for generating parameter values

Description

tunable() determines which parameters in an object can be tuned along with information about the parameters.

Usage

# S3 method for model_spec
tunable(x, ...)

# S3 method for workflow tunable(x, ...)

# S3 method for linear_reg tunable(x, ...)

# S3 method for logistic_reg tunable(x, ...)

# S3 method for multinomial_reg tunable(x, ...)

# S3 method for boost_tree tunable(x, ...)

# S3 method for rand_forest tunable(x, ...)

# S3 method for mars tunable(x, ...)

# S3 method for decision_tree tunable(x, ...)

Arguments

x

An object, such as a workflow or parsnip model specification.

...

Not currently used.

Value

A tibble with a column for the parameter name, information on the default method for generating a corresponding parameter object, the source of the parameter (e.g. "model_spec", etc.), and the component within the source. For the component column, a little more specificity is given about the location of the parameter (e.g. "boost_tree" for models). The component_id column contains the unique step id field or, for models, a logical for whether the model specification argument was a main parameter or one associated with the engine.

Details

For a model specification, an engine must be chosen.

If the object has no tunable parameters, a tibble with no rows is returned.

The information about the default parameter object takes the form of a named list with an element for the function call and an optional element for the source of the function (e.g. the dials package). For model specifications, if the parameter is unknown to the underlying tunable method, a NULL is returned.

Examples

Run this code
# NOT RUN {
library(parsnip)

boost_tree() %>%
  set_engine("xgboost") %>%
  tunable()

boost_tree() %>%
  set_engine("C5.0", rules = TRUE) %>%
  tunable()
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace