Learn R Programming

tune (version 0.1.1)

tunable: 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

tunable(x, ...)

no_param

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

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

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

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

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

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

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

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

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

# S3 method for recipe 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 recipe, recipe step, 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. "recipe", 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. "step_normalize" or recipes or "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.

Format

An object of class tbl_df (inherits from tbl, data.frame) with 0 rows and 5 columns.

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(recipes)

recipe(mpg ~ ., data = mtcars) %>%
  step_knnimpute(all_predictors()) %>%
  step_pca(all_predictors()) %>%
  tunable()

recipe(mpg ~ ., data = mtcars) %>%
  step_normalize(all_predictors()) %>%
  tunable()

library(parsnip)

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

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

Run the code above in your browser using DataLab