When using sklearn's train_test_split, what does the stratify parameter do?
-
A
Shuffles data randomly before splitting
-
B
Preserves the class distribution in both train and test sets
-
C
Normalizes feature values across splits
-
D
Ensures no duplicate samples appear in either set