Data Leakage in Notebooks: Static Detection and Better Processes
Chenyang Yang, Rachel A Brower-Sinning, Grace A. Lewis, Christian, K\"astner

TL;DR
This paper presents a static analysis method to detect data leakage in data science notebooks, revealing its widespread occurrence and offering tools to improve model evaluation integrity.
Contribution
The authors develop a static analysis approach specifically targeting data leakage in notebooks, enhancing detection accuracy and promoting better practices in data science workflows.
Findings
Data leakage is common in over 100,000 notebooks analyzed.
The static analysis accurately detects various forms of leakage.
Leakage prevention can be integrated into development processes.
Abstract
Data science pipelines to train and evaluate models with machine learning may contain bugs just like any other code. Leakage between training and test data can lead to overestimating the model's accuracy during offline evaluations, possibly leading to deployment of low-quality models in production. Such leakage can happen easily by mistake or by following poor practices, but may be tedious and challenging to detect manually. We develop a static analysis approach to detect common forms of data leakage in data science code. Our evaluation shows that our analysis accurately detects data leakage and that such leakage is pervasive among over 100,000 analyzed public notebooks. We discuss how our static analysis approach can help both practitioners and educators, and how leakage prevention can be designed into the development process.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdversarial Robustness in Machine Learning · Software Engineering Research · Machine Learning and Data Classification
