How shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub works
Purpose and Entry Points
This is a reproducible tabular ML training pipeline using DVC for orchestration/versioned artifacts and MLflow/DAGsHub for experiment tracking and model registry. Primary execution is dvc repro, defined by machinelearningpipeline/dvc.yaml; individual stages are implemented in machinelearningpipeline/src/preprocess.py, machinelearningpipeline/src/train.py, and machinelearningpipeline/src/evaluate.py.
Pipeline Orchestration
DVC defines the control boundary between stages, dependencies, parameters, and outputs. machinelearningpipeline/dvc.lock records resolved inputs/output hashes for reproducibility, while machinelearningpipeline/params.yaml supplies train-time hyperparameters. Changes to data, parameters, or source should cause affected DVC stages to rerun rather than rerunning the full workflow.
Data Ingestion and Preprocessing
The versioned raw dataset is machinelearningpipeline/data/raw/data.csv, with DVC metadata at machinelearningpipeline/data/raw/data.csv.dvc. Preprocessing transforms it into the stage-consumable dataset at machinelearningpipeline/data/processed/data.csv. The raw-to-processed transition is the principal data-quality and feature-preparation boundary.
Model Training
machinelearningpipeline/src/train.py consumes processed data and parameter values to train a classifier; tracked parameters include n_estimators, max_depth, min_samples_split, and min_samples_leaf, evidenced under machinelearningpipeline/dagshub.com/0/e0f7bc0229ce4d0eb51ff16f5fc62e57/params/. The train output is a serialized model at machinelearningpipeline/models/model.pkl, intended for DVC-managed model versioning.
Evaluation and Experiment Logging
machinelearningpipeline/src/evaluate.py evaluates the trained model and emits accuracy plus diagnostic artifacts. Recorded outputs include classification_report.txt and confusion_matrix.txt under machinelearningpipeline/dagshub.com/0/e0f7bc0229ce4d0eb51ff16f5fc62e57/artifacts/, and accuracy under machinelearningpipeline/dagshub.com/0/e0f7bc0229ce4d0eb51ff16f5fc62e57/metrics/accuracy. This stage separates model-quality evidence from model creation.
MLflow and DAGsHub Persistence
The checked-in machinelearningpipeline/dagshub.com/ hierarchy is MLflow-compatible tracking/registry state for DAGsHub. Runs retain parameters, metrics, tags, and artifacts; registered model packages include MLmodel, environment specifications, and model.pkl, e.g. machinelearningpipeline/dagshub.com/0/models/m-e2f996c06adb4c8986b38fe57de5660c/artifacts/. The logical “Best Model” registry has version metadata at machinelearningpipeline/dagshub.com/models/Best Model/version-1/meta.yaml and machinelearningpipeline/dagshub.com/models/Best Model/version-2/meta.yaml.
Runtime and External Boundaries
The runtime is Python 3.8+ with dependencies declared in machinelearningpipeline/requirements.txt. DVC manages local/remote data and model artifacts; DAGsHub provides the external Git/DVC and MLflow tracking endpoints. No serving application is present: deployment is explicitly outside the implemented pipeline.
Main entry points: dvc.yaml DVC stage graph · train.py Train stage · evaluate.py Evaluate stage · preprocess.py Preprocess stage
Components 18
DVC Pipeline
Reproducible local training workflow.
- dvc repro · Primary pipeline entry point.
- DVC stage graph · Defines stage dependencies, parameters, and outputs.
machinelearningpipeline/dvc.yaml - Resolved pipeline lock · Records resolved artifact hashes.
machinelearningpipeline/dvc.lock - Raw data metadata · Versions the raw dataset.
machinelearningpipeline/data/raw/data.csv.dvc - Raw dataset
machinelearningpipeline/data/raw/data.csv - Preprocess stage · Data-quality and feature-preparation boundary.
machinelearningpipeline/src/preprocess.py - Processed dataset · Stage-consumable training data.
machinelearningpipeline/data/processed/data.csv - Training parameters · Includes classifier hyperparameters.
machinelearningpipeline/params.yaml - Train stage · Trains the classifier.
machinelearningpipeline/src/train.py - Serialized model · DVC-managed trained model.
machinelearningpipeline/models/model.pkl - Evaluate stage · Separates quality evidence from model creation.
machinelearningpipeline/src/evaluate.py
DAGsHub / MLflow
Persisted experiment and registry state.
- Run parameters
machinelearningpipeline/dagshub.com/0/e0f7bc0229ce4d0eb51ff16f5fc62e57/params/n_estimators - Accuracy metric
machinelearningpipeline/dagshub.com/0/e0f7bc0229ce4d0eb51ff16f5fc62e57/metrics/accuracy - Evaluation diagnostics · Classification report and confusion matrix.
machinelearningpipeline/dagshub.com/0/e0f7bc0229ce4d0eb51ff16f5fc62e57/artifacts/classification_report.txt - Registered model package · Includes model metadata, environment, and binary.
machinelearningpipeline/dagshub.com/0/models/m-e2f996c06adb4c8986b38fe57de5660c/artifacts/MLmodel - Best Model registry · Logical registered model with version metadata.
machinelearningpipeline/dagshub.com/models/Best Model/version-2/meta.yaml
Other components
- Python runtime dependencies · Python 3.8+ runtime dependencies.
machinelearningpipeline/requirements.txt - DAGsHub endpoints · Remote Git/DVC and MLflow tracking boundary.
Connections 21
- dvc repro → DVC stage graph: executes
- DVC stage graph → Resolved pipeline lock: resolves into
- DVC stage graph → Preprocess stage: orchestrates
- DVC stage graph → Train stage: orchestrates
- DVC stage graph → Evaluate stage: orchestrates
- Raw data metadata → Raw dataset: versions
- Raw dataset → Preprocess stage: input
- Preprocess stage → Processed dataset: produces
- Processed dataset → Train stage: input
- Training parameters → Train stage: hyperparameters
- Train stage → Serialized model: produces
- Serialized model → Evaluate stage: input
- Evaluate stage → Accuracy metric: logs accuracy
- Evaluate stage → Evaluation diagnostics: logs artifacts
- Training parameters → Run parameters: logged as
- Serialized model → Registered model package: packaged as
- Registered model package → Best Model registry: registered as
- DVC stage graph → DAGsHub endpoints: syncs DVC artifacts
- Accuracy metric → DAGsHub endpoints: tracked by
- Python runtime dependencies → Preprocess stage: runtime
- Python runtime dependencies → Train stage: runtime