tl_tune_random: Tune hyperparameters for a model using random search

View source: R/tuning.R

tl_tune_randomR Documentation

Tune hyperparameters for a model using random search

Description

Tune hyperparameters for a model using random search

Usage

tl_tune_random(
  data,
  formula,
  method,
  param_space,
  n_iter = 10,
  folds = 5,
  metric = NULL,
  maximize = NULL,
  verbose = TRUE,
  seed = NULL,
  ...
)

Arguments

data

A data frame containing the training data

formula

A formula specifying the model

method

The modeling method to tune

param_space

A named list of parameter spaces to sample from

n_iter

Number of random parameter combinations to try

folds

Number of cross-validation folds

metric

Metric to optimize

maximize

Logical; whether to maximize (TRUE) or minimize (FALSE) the metric

verbose

Logical; whether to print progress

seed

Random seed for reproducibility

...

Additional arguments passed to tl_model

Value

A list with the best model and tuning results


tidylearn documentation built on Feb. 6, 2026, 5:07 p.m.