Why is a Pipeline preferred to scaling the whole dataset before splitting?
-
A
It picks the algorithm for the user
-
B
It refits the scaler inside each fold
Correct answer
-
C
It runs the model on a GPU faster
-
D
It removes the need for a test set
Correct answer
B. It refits the scaler inside each fold
18 views
Explanation
Inside a Pipeline, preprocessing is fitted only on training folds, which prevents data leakage.
Reference
Asked in: NTS, PPSC IT, Interviews
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ