mirror of
https://github.com/hanzoai/ml.git
synced 2026-11-20 23:08:29 +00:00
`stratified` built a FRESH `Twister` for every class, so class 1's fold assignment was shuffled with the same numbers class 0 had just used. scikit-learn walks ONE generator: the second class's shuffle continues the stream the first left off. The comment sitting on that line already said so — "one generator walks the classes in order, so the streams are consumed in the same sequence" — while the code beside it re-seeded. Reproducible, balanced, and disagreeing with scikit-learn on every fold of every seed. Nothing could have caught it. Every stratified fixture was `shuffle=False`, and a sequential plan never draws. So the shuffled plans are pinned too, at seeds 7 and 11, for all three splitters. KFold and StratifiedKFold mask their folds back onto `0..n`, so scikit-learn's own answer is already ascending and the assertion is exact on both sides; train_test_split hands its indices back in permutation order, and that one case sorts the oracle's copy, which reorders rows and cannot turn one set of rows into another. The fixture regenerates as a pure superset: of the six existing files, five are byte-identical and prepare.json gains 16 keys with no value changed and none removed.