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", "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

Optional Numeric (0, 1): Randomly test this proportion of combinations. Required when search_type is "randomized"; must be left NULL when it is "exhaustive".

metrics_aggregate_fn

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

metric

Optional Character: Metric to minimize or maximize. NULL sets it from the outcome type.

maximize

Optional Logical: If TRUE, maximize metric, otherwise minimize it. NULL sets it from the metric.

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>
#>     resampler_config:
#>                       <KFoldConfig>
#>                        n_resamples: 5
#>                       stratify_var: NULL
#>                       strat_n_bins: 4
#>                           id_strat: NULL
#>                               seed: NULL
#>          search_type: <chr> exhaustive
#>          randomize_p: <NUL> NULL
#> metrics_aggregate_fn: <chr> mean
#>               metric: <NUL> NULL
#>             maximize: <NUL> NULL
#>