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,
  parallel_type = "future",
  n_workers = rtemis_workers
)

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.

parallel_type

Character: Parallel backend to use.

n_workers

Integer: Number of workers to use.

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:  
#>                         <KFold ResamplerConfig>
#>                                      n: <int> 5
#>                           stratify_var: <NUL> NULL
#>                           strat_n_bins: <int> 4
#>                               id_strat: <NUL> NULL
#>                                   seed: <NUL> NULL
#>   metrics_aggregate_fn: <chr> mean
#>                 metric: <NUL> NULL
#>               maximize: <NUL> NULL
#>          parallel_type: <chr> future
#>              n_workers: <int> 7