solow-cv
Cross-validation, resampling, and bootstrap for the Solow statistical stack.
Coverage
- Splitters —
KFold,StratifiedKFold,TimeSeriesSplit(withtest_size,gap,max_train_sizefor rolling-window walk-forward),LeaveOneOut, and seededShuffleSplitbehind a sharedSplittertrait. - Group-aware and leakage-safe splitters —
GroupKFoldandStratifiedGroupKFold(no group is ever split across a fold),PurgedKFold(walk-forward + purge + embargo, López de Prado 2018), andCombinatorialPurgedKFold(every C(n_splits, n_test) block subset as a test fold — the standard leakage-safe splitter for financial back-tests). - Cross-validated scoring —
cross_val_score(splitter, n, fit_and_score)andcross_val_score_from_folds(...). ReturnsCrossValScores { scores, n_folds }withmean(),std(), andstandard_error(). - Parallel evaluation (opt-in
parallelfeature) —cross_val_score_parallel(...)runs every fold on a rayon thread pool. - Bootstrap confidence intervals —
bootstrap_ci(n, statistic, n_boot, confidence, method, seed)with the classical percentile method, the reverse-percentile ("basic") method, and Efron's bias-corrected and accelerated (BCa) method using a jackknife acceleration estimate.
Determinism
Random splits and bootstrap resamples use a portable 64-bit MMIX-LCG, seeded by the caller. A fixed seed produces bit-for-bit identical folds and replicates across runs and platforms.
Features
parallel— enablescross_val_score_parallel(adds arayondependency).serde— derivesSerialize/DeserializeonSplit,CrossValScores, andBootstrapCifor JSON persistence.
Example
use array;
use ;
let y = array!;
let kf = new?.shuffle;
for split in kf.split?
# Ok::
License
Licensed under either of Apache License 2.0 or MIT license at your option.