tune: Hyperparameter tuning on rsample objects

Description Usage Arguments Details Value

View source: R/tune.R

Description

'tune“ is a generic function that accepts a tibble of resampling partitions generated by the resampling schemes available in the 'rsample' package. A 'parsnip' model specification and a 'recipes' recipe also need to be supplied to this function, along with a 'yardstick' scoring function. The 'param_grid' function accepts a 'grid_regular' or 'grid_random' object of tuning parameters generated by the 'dials' package. Hyperparameter tuning is then performed on this object, which is returned as a tibble with an additional list-column called 'tune_scores' containing the tuning scores.

Usage

1
2
tune(resamples, object, recipe = NULL, param_grid, scoring,
  maximize = TRUE, .options = future_options())

Arguments

resamples

tibble generated by rsample containing resamplign scheme

object

parsnip model specification, or a pipeline object

recipe

recipe object, optional if using a pipeline

param_grid

dials grid_regular or grid_random object

scoring

yardstick scoring function

maximize

logical, maximize the scoring function, default = TRUE

.options

future_options to pass additional packages required by tuning and fitting functions

Details

If the resampling object represents a 'nested_cv' object, then hyperparameter tuning is performed on the inner resampling partitions, and best best hyperparameters per outer fold are also returned as additional columns in the output tibble.

Value

tibble containing resampling results


stevenpawley/tidycrossval documentation built on Oct. 3, 2019, 3:32 p.m.