What is data leakage, and how would you prevent it in a preprocessing pipeline?
Interactive Practice Mode
Formulate your thoughts or take notes before revealing the model solution.
Saved automatically
Model Answer & Deep-Dive Explanation
Leakage occurs when training or evaluation uses information that would not be available at prediction time or information from the held-out data. Examples include scaling before splitting, selecting features using all labels, or using a refund status to predict an earlier fraud decision. Split first, fit transformations only on training partitions, and apply them unchanged to validation data. Keep preprocessing inside cross-validation folds. For repeated users or time-dependent records, choose group-aware or chronological splits so near-duplicate or future information does not cross the boundary.
Related Questions in AI & Machine Learning
Explain Retrieval-Augmented Generation (RAG) Architecture vs Model Fine-Tuning
Advanced level • 1863 views
Explain the Transformer Architecture and Multi-Head Self-Attention in LLMs
Advanced level • 1432 views
How do you detect and mitigate Overfitting vs Underfitting in deep neural networks?
Intermediate level • 1190 views
Explain the Self-Attention mechanism in Transformer architectures and how its computational complexity scales with sequence length.
Advanced level • 159 views
test
Medium level • 9 views