Fair Splits for Categories
Fair Splits for Categories: Stratified Splits.
Updated
- Stratified Splits (Journeyman): A random split can leave more or fewer of one class in the test part than in the data, and stratify=y makes train_test_split keep each class's share the same in both parts, which you check with value_counts(normalize=True).