| .permute_labels_factory | R Documentation |
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
)
cd |
data.frame of sample metadata. |
outcome |
outcome column name. |
mode |
resampling mode (subject_grouped, batch_blocked, study_loocv, time_series). |
folds |
list of fold descriptors from |
perm_stratify |
logical or "auto"; if TRUE, permute within strata. |
time_block |
time-series block permutation method. |
block_len |
block length for time-series permutations. |
seed |
integer seed. |
group_col, batch_col, study_col |
optional metadata columns. |
time_col |
optional metadata column name for time-series ordering. |
verbose |
logical; print progress messages. |
A function that returns a list of permuted outcome vectors, one per fold.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.