setup_GridSearch: Setup Grid Search Config

View source: R/110_Tuner.R

setup_GridSearchR Documentation

Setup Grid Search Config

Description

Create a GridSearchConfig object that can be passed to train.

Usage

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

Arguments

resampler_config

Optional ResamplerConfig: Resampling configuration from a ⁠setup_*⁠ resampler function, e.g. setup_KFold.

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 maximizes accuracy, balanced_accuracy, sensitivity, specificity, ppv, npv, f1, auc, rsq and Concordance, and minimizes every other metric, including mae, mse, rmse and brier_score.

Value

A GridSearchConfig object.

Author(s)

EDG

Examples

gridsearch_config <- setup_GridSearch(
  resampler_config = setup_KFold(n_resamples = 5L),
  search_type = "exhaustive"
)
gridsearch_config

rtemis documentation built on Oct. 20, 2026, 1:06 a.m.