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

Quiz: ML and Regression · Question 10 of 10

Why set randomstate=42 in traintestsplit?

Why set random_state=42 in train_test_split?

  1. A.42 gives the most accurate model
  2. B.It removes the test set
  3. C.It makes training faster
  4. D.The same split is produced every run, so results can be reproduced
Answer & explanation

Correct answer: The same split is produced every run, so results can be reproduced

Any fixed number works; the point is repeatability.

Can you get the rest right without peeking?

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

Start the quiz →