Does train_test_split shuffle the data by default?
-
A
No, the original order is kept
-
B
Only when random_state is given
-
C
Only for regression targets
-
D
Yes, shuffle defaults to True
Correct answer
Correct answer
D. Yes, shuffle defaults to True
13 views
Explanation
train_test_split shuffles the rows before splitting unless shuffle=False is passed.
Reference
Asked in: NTS, PPSC IT, Interviews
Doubts & discussion
Not sure why the answer is D? Ask here and get an explanation.
Ask a doubt about this MCQ