Repeats borg_cv multiple times with different random seeds
and aggregates the results. Repeated CV provides better variance
estimates and more stable performance metrics than a single CV run,
particularly important for spatial/temporal blocking where fold
assignment depends on the random seed.
Arguments
- data
A data frame.
- repeats
Integer. Number of repetitions. Default: 10.
- v
Integer. Number of folds per repetition. Default: 5.
- seeds
Integer vector of length
repeats, or NULL (auto-generated). Controls fold assignment for each repetition.- aggregate
Logical. If TRUE (default), returns aggregated metrics. If FALSE, returns all individual fold results.
- ...
Additional arguments passed to
borg_cv.
Value
A list with class "borg_repeated_cv" containing:
- folds
List of length
repeats, each element a list ofvtrain/test fold pairs.- repeats
Number of repetitions.
- v
Number of folds.
- strategy
CV strategy used.
- seeds
Seeds used for each repetition.
- diagnosis
The
BorgDiagnosisfrom the first run.
Has print() and autoplot() methods.
Details
Each repetition calls borg_cv() with a different seed, producing
different fold assignments. The diagnosis is computed once and reused
across repetitions for consistency.
For aggregation with a model, use borg_fold_performance()
on each repetition's folds and combine the results.