Builds a closure that generates permuted outcome vectors per fold while
respecting grouping/batch/study/time constraints used in
audit_leakage(). Numeric outcomes can be stratified by quantiles to
preserve outcome structure under permutation.
.permute_labels_factory(
cd,
outcome,
mode,
folds,
perm_stratify,
time_block,
block_len,
seed,
group_col = NULL,
batch_col = NULL,
study_col = NULL,
time_col = NULL,
verbose = FALSE
)A function that returns a list of permuted outcome vectors, one per fold.
data.frame of sample metadata.
outcome column name.
resampling mode (subject_grouped, batch_blocked, study_loocv, time_series).
list of fold descriptors from LeakSplits. When compact
splits are used, fold assignments are read from the
fold_assignments attribute.
logical or "auto"; if TRUE, permute within strata.
time-series block permutation method.
block length for time-series permutations.
integer seed.
optional metadata columns.
optional metadata column name for time-series ordering.
logical; print progress messages.