Stratify - 5.2 English - 68552

AOCL API Guide (68552)

Document ID
68552
Release Date
2025-12-29
Version
5.2 English

If stratification is enabled, train_test_split will try to ensure that the relative proportions of classes in the training and test sets is the same as in the original dataset. This is particularly useful for classification tasks where you want to ensure that both sets have a representative distribution of classes.