🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Classification: all 10 questions

Quiz: Classification · Question 5 of 10

What does stratify=y do in traintestsplit?

What does stratify=y do in train_test_split?

  1. A.Sorts the data by y
  2. B.Keeps the same class proportions in the train and test sets
  3. C.Removes the minority class
  4. D.Scales the features
Answer & explanation

Correct answer: Keeps the same class proportions in the train and test sets

Important for small or imbalanced datasets.

Can you get the rest right without peeking?

Take the timed Quiz: Classification quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →