tune (version 0.1.2)

tune_args: Determine arguments tagged for tuning

Description

tune_args() takes a model specification or a recipe and returns a tibble of information on all possible tunable arguments and whether or not they are actually tunable.

Usage

tune_args(object, ...)

# S3 method for model_spec tune_args(object, full = FALSE, ...)

# S3 method for recipe tune_args(object, full = FALSE, ...)

# S3 method for step tune_args(object, full = FALSE, ...)

# S3 method for check tune_args(object, full = FALSE, ...)

# S3 method for workflow tune_args(object, ...)

Arguments

object

A model_spec, recipe, workflow or other object.

...

Not currently used.

full

A single logical. Should all possible tunable parameters be returned? If FALSE, then only the parameters that are actually tunable are returned.

Value

A tibble with columns for the parameter name (name), whether it contains any tunable value (tune), the id for the parameter (id), and the information on where the parameter was located (source).

Details

The source column is determined differently depending on whether a model_spec or a recipe is used (with additional detail on the type).

The id field has any identifier that was passed to tune() (e.g. tune("some note")). If not additional detail was used in that function, the id field reverts to the name of the parameters.

Examples

Run this code
# NOT RUN {
library(recipes)

recipe(mpg ~ ., data = mtcars) %>%
  step_knnimpute(all_predictors(), neighbors = tune()) %>%
  step_pca(all_predictors(), num_comp = tune()) %>%
  tune_args()

recipe(mpg ~ ., data = mtcars) %>%
  step_ns(disp, deg_free = tune("disp df")) %>%
  step_ns(wt, deg_free = tune("wt df")) %>%
  tune_args()

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

library(parsnip)

boost_tree(trees = tune(), min_n = tune()) %>%
  set_engine("xgboost") %>%
  tune_args()

boost_tree(trees = tune(), min_n = tune()) %>%
  set_engine("C5.0", rules = TRUE) %>%
  tune_args()
# }

Run the code above in your browser using DataCamp Workspace