# hammad112/pima_diabetes architecture

> Architecture diagram of the GitHub repository hammad112/pima_diabetes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hammad112/pima_diabetes
- Repository: https://github.com/hammad112/pima_diabetes

## Overview

##### Project type and purpose
- This is an end-to-end machine‐learning pipeline project. It uses DVC for data and model versioning and MLflow for experiment tracking. The primary goal is reproducible preprocessing, training, and evaluation of a Random Forest Classifier on the Pima Indians Diabetes Dataset.

##### File structure
- Top-level:
- data/raw (raw CSV, DVC controlled)
- data/processed (output of preprocess)
- src (preprocess.py, train.py, evaluate.py)
- models (saved model artifact)
- dvc.yaml / dvc.lock, params.yaml (pipeline definitions, parameters)
- README.md, requirements.txt
- Patterns: sequential DVC stages (preprocess → train → evaluate).
- Config files: dvc.yaml defines dependencies/outputs; params.yaml holds hyperparameters; requirements.txt captures Python dependencies.

##### README for additional insights
- Confirms three pipeline stages (preprocess, train, evaluate).
- Describes use of DVC for versioning and MLflow for logging metrics, parameters, and artifacts.
- Lists tech stack: Python, Scikit-learn, DVC, MLflow.

##### Detail and essential elements
- Params.yaml feeding into both preprocess and train stages.
- Where metrics and artifacts land in MLflow.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Layer
    Raw["Raw Dataset\ndata/raw/data.csv"]:::data
    Processed["Processed Dataset\ndata/processed/data.csv"]:::data

    %% Compute Layer
    Pre["Preprocessing Service\nsrc/preprocess.py"]:::code
    Train["Training Service\nsrc/train.py"]:::code
    Eval["Evaluation Service\nsrc/evaluate.py"]:::code

    %% Artifact Layer
    Model["Model Artifact\nmodels/model.pkl"]:::data

    %% External Services
    MLflow["MLflow Server"]:::external
    DVCRemote["DVC Remote Storage"]:::external
    Git["Git Repository"]:::external

    %% Orchestration & Config
    subgraph "Version Control / Orchestration"
        DVCP["DVC Pipeline\ndvc.yaml"]:::external
        DVCL["DVC Lock\ndvc.lock"]:::external
        Params["Pipeline Params\nparams.yaml"]:::code
        Req["Requirements\nrequirements.txt"]:::code
        Readme["README.md"]:::code
    end

    %% Data Flow
    Raw -->|reads raw data| Pre
    Pre -->|writes processed data| Processed
    Processed -->|reads processed data| Train
    Train -->|saves model| Model
    Processed -->|reads processed data| Eval
    Model -->|loads model| Eval

    %% DVC Tracking
    Pre -->|"track output"| DVCP
    Train -->|"track output"| DVCP
    Model -->|"track output"| DVCP
    DVCL --> DVCP
    DVCP -->|push to remote| DVCRemote

    %% Params & Code Dependencies
    Params --> Pre
    Params --> Train
    Git -.-> Pre
    Git -.-> Train
    Git -.-> Eval
    Git -.-> DVCP
    Git -.-> DVCL
    Git -.-> Params
    Git -.-> Req
    Git -.-> Readme

    %% Experiment Tracking
    Train -->|logs metrics & params| MLflow
    Eval -->|logs evaluation| MLflow

    %% Click Events
    click Raw "https://github.com/hammad112/pima_diabetes/blob/main/data/raw/data.csv"
    click Processed "https://github.com/hammad112/pima_diabetes/blob/main/data/processed/data.csv"
    click Pre "https://github.com/hammad112/pima_diabetes/blob/main/src/preprocess.py"
    click Train "https://github.com/hammad112/pima_diabetes/blob/main/src/train.py"
    click Eval "https://github.com/hammad112/pima_diabetes/blob/main/src/evaluate.py"
    click Model "https://github.com/hammad112/pima_diabetes/blob/main/models/model.pkl"
    click DVCP "https://github.com/hammad112/pima_diabetes/blob/main/dvc.yaml"
    click DVCL "https://github.com/hammad112/pima_diabetes/blob/main/dvc.lock"
    click Params "https://github.com/hammad112/pima_diabetes/blob/main/params.yaml"
    click Req "https://github.com/hammad112/pima_diabetes/blob/main/requirements.txt"
    click Readme "https://github.com/hammad112/pima_diabetes/blob/main/README.md"

    %% Styles
    classDef data fill:#a0e6a0,stroke:#2a7f2a,stroke-width:2px
    classDef code fill:#a0c4ff,stroke:#1a52a1,stroke-width:2px
    classDef external fill:#ffd2a1,stroke:#a15600,stroke-width:2px
    classDef dashed stroke-dasharray: 5 5, stroke:#999,stroke-width:1px
```
