Unit-tests for machine learning pipelines
summary
End to end example builds a binary classifier on a Kaggle Pokemon set and shows concrete tests for each pipeline step: CSV loading and quality checks, pandas transformations for feature engineering, hyperparameter tuning and a scikit-learn logistic regression fit checked for instance type and feature names, and batch serving that writes predictions to disk. Tests use pytest parametrize for scenario matrices and a tempdir fixture to create fake input folders. Repository with runnable examples is linked for reproduction and CI integration.
AI-written summary · about
chapters (15)
- 0:00Intro
- 0:48Data science workflow
- 2:51What are unittests
- 4:27Unittests for data science
- 5:14How did I design this pipeline
- 6:38Writing notebooks efficiently
- 8:48Test structure
- 9:51Examples
- 12:54What if
- 15:55Macro
- 17:04Training
- 19:25Conclusion
- 20:42Spark session
- 21:50GitHub repo
- 22:30Questions
related talks
27mPyTesting the Limits of Machine Learning
51mHow to Test Artificial Intelligence and Machine Learning Solutions?
50mDesigning tests for ML libraries
43mDeploying Machine Learning using sklearn pipelines
37mSoftware Development for Machine Learning in Python
01h 29mAdv. Software Testing for Data Scientists
32mTesting Machine Learning Systems: What it is and why you should care
29mTDD shouldn't be TDDious
