Skip to main content

stratified_k_fold

Function stratified_k_fold 

Source
pub fn stratified_k_fold(
    labels: &[usize],
    folds: usize,
    seed: u64,
) -> Result<Vec<Split>, ErrorsJSL>
Expand description

Stratified k-fold: each class is dealt round-robin across the folds (after a seeded shuffle within the class), so every fold has nearly the overall class proportions.