How does wrapping transformations inside a pipeline object protect against data leakage?
Role: Machine Learning Engineer
Category: Machine Learning
Difficulty: medium
Interview Round: Other
Overview: Explain how putting preprocessing steps inside a pipeline object prevents data leakage during cross-validation and hyperparameter tuning. It tests whether you know which statistics leak when transformers are fitted on all the data, how fit and predict flow through the steps, and what a pipeline cannot protect against.