# shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub architecture

> Architecture diagram of the GitHub repository shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub
- Repository: https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub

## Overview

#### 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: [`machinelearningpipeline/dvc.yaml`](https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/dvc.yaml) (DVC stage graph), [`machinelearningpipeline/src/train.py`](https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/src/train.py) (Train stage), [`machinelearningpipeline/src/evaluate.py`](https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/src/evaluate.py) (Evaluate stage), [`machinelearningpipeline/src/preprocess.py`](https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/src/preprocess.py) (Preprocess stage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pipeline["DVC Pipeline"]
  node_dvc_repro{{"dvc repro<br/>execution"}}
  node_dvc_pipeline{{"DVC stage graph<br/>orchestrator<br/>[dvc.yaml]"}}
  node_dvc_lock["Resolved pipeline lock<br/>lockfile<br/>[dvc.lock]"]
  node_raw_metadata["Raw data metadata<br/>DVC pointer<br/>[data.csv.dvc]"]
  node_raw_data[("Raw dataset<br/>CSV data<br/>[data.csv]")]
  node_preprocess["Preprocess stage<br/>Python stage<br/>[preprocess.py]"]
  node_processed_data[("Processed dataset<br/>CSV data<br/>[data.csv]")]
  node_params["Training parameters<br/>YAML parameters<br/>[params.yaml]"]
  node_train["Train stage<br/>Python stage<br/>[train.py]"]
  node_model["Serialized model<br/>model artifact<br/>[model.pkl]"]
  node_evaluate["Evaluate stage<br/>Python stage<br/>[evaluate.py]"]
end

subgraph group_tracking["DAGsHub / MLflow"]
  node_run_params["Run parameters<br/>MLflow parameters<br/>[n_estimators]"]
  node_metrics["Accuracy metric<br/>MLflow metric<br/>[accuracy]"]
  node_diagnostics["Evaluation diagnostics<br/>MLflow artifact"]
  node_model_package["Registered model package<br/>MLflow model artifact<br/>[MLmodel]"]
  node_best_model[("Best Model registry<br/>[meta.yaml]")]
end

node_requirements["Python runtime dependencies<br/>requirements<br/>[requirements.txt]"]
node_dagshub(("DAGsHub endpoints<br/>external platform"))

node_dvc_repro -->|"executes"| node_dvc_pipeline
node_dvc_pipeline -->|"resolves into"| node_dvc_lock
node_dvc_pipeline -->|"orchestrates"| node_preprocess
node_dvc_pipeline -->|"orchestrates"| node_train
node_dvc_pipeline -->|"orchestrates"| node_evaluate
node_raw_metadata -->|"versions"| node_raw_data
node_raw_data -->|"input"| node_preprocess
node_preprocess -->|"produces"| node_processed_data
node_processed_data -->|"input"| node_train
node_params -->|"hyperparameters"| node_train
node_train -->|"produces"| node_model
node_model -->|"input"| node_evaluate
node_evaluate -->|"logs accuracy"| node_metrics
node_evaluate -->|"logs artifacts"| node_diagnostics
node_params -.->|"logged as"| node_run_params
node_model -->|"packaged as"| node_model_package
node_model_package -->|"registered as"| node_best_model
node_dvc_pipeline -.->|"syncs DVC artifacts"| node_dagshub
node_metrics -.->|"tracked by"| node_dagshub
node_requirements -.->|"runtime"| node_preprocess
node_requirements -.->|"runtime"| node_train

click node_dvc_pipeline "https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/dvc.yaml"
click node_dvc_lock "https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/dvc.lock"
click node_raw_metadata "https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/data/raw/data.csv.dvc"
click node_raw_data "https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/data/raw/data.csv"
click node_preprocess "https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/src/preprocess.py"
click node_processed_data "https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/data/processed/data.csv"
click node_params "https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/params.yaml"
click node_train "https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/src/train.py"
click node_model "https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/models/model.pkl"
click node_evaluate "https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/src/evaluate.py"
click node_run_params "https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/dagshub.com/0/e0f7bc0229ce4d0eb51ff16f5fc62e57/params/n_estimators"
click node_metrics "https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/dagshub.com/0/e0f7bc0229ce4d0eb51ff16f5fc62e57/metrics/accuracy"
click node_diagnostics "https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/dagshub.com/0/e0f7bc0229ce4d0eb51ff16f5fc62e57/artifacts/classification_report.txt"
click node_model_package "https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/dagshub.com/0/models/m-e2f996c06adb4c8986b38fe57de5660c/artifacts/MLmodel"
click node_best_model "https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/dagshub.com/models/Best%20Model/version-2/meta.yaml"
click node_requirements "https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/requirements.txt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dvc_repro,node_dvc_pipeline,node_dvc_lock,node_raw_metadata,node_raw_data,node_preprocess,node_processed_data,node_params,node_train,node_model,node_evaluate toneBlue
class node_run_params,node_metrics,node_diagnostics,node_model_package,node_best_model toneAmber
class node_requirements,node_dagshub toneNeutral
```

## Components

### DVC Pipeline

Reproducible local training workflow.

- **dvc repro**: execution · Primary pipeline entry point.
- [DVC stage graph](https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/dvc.yaml): orchestrator · Defines stage dependencies, parameters, and outputs. · `machinelearningpipeline/dvc.yaml`
- [Resolved pipeline lock](https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/dvc.lock): lockfile · Records resolved artifact hashes. · `machinelearningpipeline/dvc.lock`
- [Raw data metadata](https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/data/raw/data.csv.dvc): DVC pointer · Versions the raw dataset. · `machinelearningpipeline/data/raw/data.csv.dvc`
- [Raw dataset](https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/data/raw/data.csv): CSV data · `machinelearningpipeline/data/raw/data.csv`
- [Preprocess stage](https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/src/preprocess.py): Python stage · Data-quality and feature-preparation boundary. · `machinelearningpipeline/src/preprocess.py`
- [Processed dataset](https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/data/processed/data.csv): CSV data · Stage-consumable training data. · `machinelearningpipeline/data/processed/data.csv`
- [Training parameters](https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/params.yaml): YAML parameters · Includes classifier hyperparameters. · `machinelearningpipeline/params.yaml`
- [Train stage](https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/src/train.py): Python stage · Trains the classifier. · `machinelearningpipeline/src/train.py`
- [Serialized model](https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/models/model.pkl): model artifact · DVC-managed trained model. · `machinelearningpipeline/models/model.pkl`
- [Evaluate stage](https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/src/evaluate.py): Python stage · Separates quality evidence from model creation. · `machinelearningpipeline/src/evaluate.py`

### DAGsHub / MLflow

Persisted experiment and registry state.

- [Run parameters](https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/dagshub.com/0/e0f7bc0229ce4d0eb51ff16f5fc62e57/params/n_estimators): MLflow parameters · `machinelearningpipeline/dagshub.com/0/e0f7bc0229ce4d0eb51ff16f5fc62e57/params/n_estimators`
- [Accuracy metric](https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/dagshub.com/0/e0f7bc0229ce4d0eb51ff16f5fc62e57/metrics/accuracy): MLflow metric · `machinelearningpipeline/dagshub.com/0/e0f7bc0229ce4d0eb51ff16f5fc62e57/metrics/accuracy`
- [Evaluation diagnostics](https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/dagshub.com/0/e0f7bc0229ce4d0eb51ff16f5fc62e57/artifacts/classification_report.txt): MLflow artifact · Classification report and confusion matrix. · `machinelearningpipeline/dagshub.com/0/e0f7bc0229ce4d0eb51ff16f5fc62e57/artifacts/classification_report.txt`
- [Registered model package](https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/dagshub.com/0/models/m-e2f996c06adb4c8986b38fe57de5660c/artifacts/MLmodel): MLflow model artifact · Includes model metadata, environment, and binary. · `machinelearningpipeline/dagshub.com/0/models/m-e2f996c06adb4c8986b38fe57de5660c/artifacts/MLmodel`
- [Best Model registry](https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/dagshub.com/models/Best%20Model/version-2/meta.yaml): model registry · Logical registered model with version metadata. · `machinelearningpipeline/dagshub.com/models/Best Model/version-2/meta.yaml`

### Other components

- [Python runtime dependencies](https://github.com/shivammitra/end-to-end-ml-project-using-git-dvc-mlflow-dagshub/blob/main/machinelearningpipeline/requirements.txt): requirements · Python 3.8+ runtime dependencies. · `machinelearningpipeline/requirements.txt`
- **DAGsHub endpoints**: external platform · Remote Git/DVC and MLflow tracking boundary.

## Connections

- 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
