How the sizes are worked out
- Split sizes: total rows × percentage, floored, then leftover rows to the largest fractional remainders.
- Class totals: your class counts, scaled to the total number of rows with the same rounding rule.
- Stratified rows: train rows are spread across classes by class size; validation is spread across what remains; each class's remainder is its test count.
- K-fold: first N mod k folds get one extra validation row.
Because every step uses the same rounding rule, the rows in each split and the rows in each class both add up exactly.