Skip to main content

Module folds

Module folds 

Source
Expand description

Resampling index generators — k-fold / LOOCV splits and train/test partition, with a deterministic shuffle so results are reproducible.

Structs§

Fold
One train/test split by row index.

Functions§

k_fold
k-fold splits over n rows. shuffle_rows randomizes fold membership (seeded); otherwise folds are contiguous blocks. Empty if k < 2 or k > n.
loocv
Leave-one-out cross-validation = n-fold (each test set is a single row).
train_test_split
A single train/test partition: test_fraction of the (shuffled) rows go to test. None if test_fraction is not in (0,1) or n < 2.