setup_KFold: Setup KFold Resampler

View source: R/100_Resampler.R

setup_KFoldR Documentation

Setup KFold Resampler

Description

Setup KFold Resampler

Usage

setup_KFold(
  n_resamples = 10L,
  stratify_var = NULL,
  strat_n_bins = 4L,
  id_strat = NULL,
  seed = NULL
)

Arguments

n_resamples

Integer [1, Inf): Number of resamples to make.

stratify_var

Optional Character: Variable to stratify by.

strat_n_bins

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

id_strat

Optional Character: Name of the column holding 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. Requires that resample() be given the data frame the column lives in. train takes the column as a case identifier, so it groups the resamples by it and excludes it from the features.

seed

Optional Integer [0, Inf): Random seed.

Value

KFoldConfig object.

Author(s)

EDG

Examples

tenfold_resampler <- setup_KFold(n_resamples = 10L, seed = 2026L)
tenfold_resampler

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