vimpute_tune_control: Control the hyperparameter tuning of 'vimpute()'

View source: R/vimpute_tune_control.R

vimpute_tune_controlR Documentation

Control the hyperparameter tuning of vimpute()

Description

Bundles the tuning controls that vimpute(tune = TRUE) previously hard-coded: the evaluation budget, the cross-validation folds of the tuning resampling, the mlr3tuning tuner and its batch size. Pass the result to vimpute(tune_control = ). With m > 1 the control applies to the single tuning run (run 1), whose parameters all m imputations share.

Usage

vimpute_tune_control(
  budget = NULL,
  folds = NULL,
  tuner = "random_search",
  batch_size = 1L
)

Arguments

budget

NULL or a single positive integer: the number of configurations the tuner evaluates. NULL (default) keeps the per-learner, data-size-dependent budgets of the built-in search spaces (see vimpute_search_space()).

folds

NULL or a single integer >= 2: the cross-validation folds used during tuning (capped by what the data supports). NULL (default) keeps the heuristic of 5 folds up to 3000 rows, 3 above.

tuner

Single string: an mlr3tuning tuner id, e.g. "random_search" (default) or "grid_search". Tuners beyond the defaults may require additional packages.

batch_size

Single positive integer: configurations evaluated per tuner batch. The default 1 keeps the random-search RNG consumption machine-independent, so ⁠seed =⁠ reproduces tuning results everywhere; larger values evaluate in batches (faster with a parallel future::plan, still reproducible for a fixed value).

Details

Nested resampling is intentionally not offered: the goal of tuning inside an imputation loop is good imputations, not an unbiased estimate of the learner's generalisation error, and the tuned-vs-default comparison that vimpute() runs on a fresh resampling already guards against tuning that overfits the folds.

Value

An object of class vimpute_tune_control.

See Also

vimpute(), vimpute_search_space()

Examples

## Not run: 
data(sleep)
res <- vimpute(sleep[, c("Sleep", "Dream", "Span")], method = "ranger",
               tune = TRUE, sequential = FALSE,
               tune_control = vimpute_tune_control(budget = 10, folds = 3))
attr(res, "tuning_log")

## End(Not run)

VIM documentation built on Sept. 2, 2026, 5:07 p.m.