1. Home
  2. Data Science
  3. Scikit-learn
  4. Why is a Pipeline preferred to scaling the whole dataset…

Added 30 Nov -0001

Why is a Pipeline preferred to scaling the whole dataset before splitting?

  1. It picks the algorithm for the user
  2. It refits the scaler inside each fold Correct answer
  3. It runs the model on a GPU faster
  4. It removes the need for a test set

Correct answer

B. It refits the scaler inside each fold

18 views

MCQSEXAM

Explanation

Inside a Pipeline, preprocessing is fitted only on training folds, which prevents data leakage.

Reference

Asked in: NTS, PPSC IT, Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Scikit-learn MCQs

Practise all Scikit-learn MCQs

Similar MCQs