Skip to contents

Setup Resampler

Usage

setup_Resampler(
  n_resamples = 10L,
  type = c("KFold", "StratSub", "StratBoot", "Bootstrap", "LOOCV"),
  stratify_var = NULL,
  train_p = 0.75,
  strat_n_bins = 4L,
  target_length = NULL,
  id_strat = NULL,
  seed = NULL,
  verbosity = 1L
)

Arguments

n_resamples

Integer [1, Inf): Number of resamples to make. LOOCV determines it from the data and ignores this.

type

Character {"KFold", "StratSub", "StratBoot", "Bootstrap", "LOOCV", "Custom"}: Type of resampler.

stratify_var

Optional Character: Variable to stratify by.

train_p

Numeric (0, 1): Training set percentage.

strat_n_bins

Integer [1, Inf): Number of bins to stratify by.

target_length

Optional Integer [1, Inf): Target length for stratified bootstraps.

id_strat

Optional Character vector: Per-case grouping IDs, e.g. subject IDs when the dataset contains repeated measurements. Cases sharing an ID stay in the same resample, so a case can only be present in the training or the test set, not both.

seed

Optional Integer [0, Inf): Random seed.

verbosity

Integer: Verbosity level.

Value

ResamplerConfig object.

Author

EDG

Examples

tenfold_resampler <- setup_Resampler(n_resamples = 10L, type = "KFold", seed = 2026L)
tenfold_resampler
#> <KFoldConfig>
#>  n_resamples: 10
#> stratify_var: NULL
#> strat_n_bins: 4
#>     id_strat: NULL
#>         seed: 2026