Skip to contents

Create a GridSearchConfig object that can be passed to train.

Usage

setup_GridSearch(
  resampler_config = setup_Resampler(n_resamples = 5L, type = "KFold"),
  search_type = "exhaustive",
  randomize_p = NULL,
  metrics_aggregate_fn = "mean",
  metric = NULL,
  maximize = NULL
)

Arguments

resampler_config

ResamplerConfig set by setup_Resampler.

search_type

Character: "exhaustive" or "randomized". Type of grid search to use. Exhaustive search will try all combinations of config. Randomized will try a random sample of size randomize_p * N of total combinations

randomize_p

Float (0, 1): For search_type == "randomized", randomly test this proportion of combinations.

metrics_aggregate_fn

Character: Name of function to use to aggregate error metrics.

metric

Character: Metric to minimize or maximize.

maximize

Logical: If TRUE, maximize metric, otherwise minimize it.

Value

A GridSearchConfig object.

Author

EDG

Examples

gridsearch_config <- setup_GridSearch(
  resampler_config = setup_Resampler(n_resamples = 5L, type = "KFold"),
  search_type = "exhaustive"
)
gridsearch_config
#> <GridSearch TunerConfig>
#>          search_type: <chr> exhaustive
#>     resampler_config:
#>                       <KFoldConfig>
#>                                  n: 5
#>                       stratify_var: NULL
#>                       strat_n_bins: 4
#>                           id_strat: NULL
#>                               seed: NULL
#> metrics_aggregate_fn: <chr> mean
#>               metric: <NUL> NULL
#>             maximize: <NUL> NULL
#>