How would you ensure reproducibility in an ML pipeline?
ML System DesignLevel: IntermediateML system design and MLOps
How would you ensure reproducibility in an ML pipeline?
Hints
- Start with quality, load and latency requirements.
- Trace data to prediction; identify a failure point and a validation method.
Answer
Key practices: version everything — code (git), data (data versioning tools like DVC, or immutable dataset snapshots), model artifacts, and the exact library/dependency versions (containerization via Docker, pinned requirements). Set and log random seeds for any stochastic process (train/test split, model initialization, shuffling). Use experiment tracking (MLflow, Weights & Biases) to log hyperparameters, metrics, and artifacts for every run, so any past result can be traced back to the exact code/data/config that produced it. Ideally, the whole pipeline (data prep → training → evaluation) is expressed as declarative, orchestrated steps (Airflow, Kubeflow) rather than manual notebook execution, so it can be re-run deterministically.
Source and licence: Ishan Dutta — Awesome Data Science Interview Q&A · MIT