Skip to contents

The set of hyperparameter combinations a grid search would fit, one per row. Derived from the object, so it can be inspected before train() is called.

Usage

tuning_grid(x)

Arguments

x

Hyperparameters object.

Value

data.frame with one row per combination and one column per searched hyperparameter, or NULL if nothing needs tuning.

Details

The grid is the cross product of the search values, reduced by two rules:

  • A hyperparameter that declares it applies only under certain values of another is set to NA – meaning "left unset for this fit" – in the rows that do not meet them. reduce_basis applies only at smoothness_orders of 0, so a search over both drops it from the higher-order rows.

  • Rows that become identical once that is done are collapsed, so a combination is never fit, scored, and ranked twice.

tune_GridSearch() fits exactly these rows, so what this prints is what will run.

Author

EDG

Examples

# reduce_basis applies only at smoothness order 0, so the six combinations
# of the cross product reduce to four.
tuning_grid(
  setup_HAL(
    smoothness_orders = tune_over(0L, 1L, 2L),
    reduce_basis = tune_over(0.1, 0.5)
  )
)
#>   smoothness_orders reduce_basis
#> 1                 0          0.1
#> 2                 1           NA
#> 3                 2           NA
#> 4                 0          0.5