← 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?
- A.42 gives the most accurate model
- B.It removes the test set
- C.It makes training faster
- 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 →