# akshatmittu/machine-learning-model-reliability-analysis-at-production-level architecture

> Architecture diagram of the GitHub repository akshatmittu/machine-learning-model-reliability-analysis-at-production-level, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akshatmittu/machine-learning-model-reliability-analysis-at-production-level
- Repository: https://github.com/akshatmittu/machine-learning-model-reliability-analysis-at-production-level

## Overview

##### Project Type and Purpose
- This is a monolithic, full-stack Python application whose primary goal is to provide an interactive dashboard for evaluating and monitoring the reliability of production ML models (regression, classification, NLP, and CV). It leverages Python scripts for the UI (likely Streamlit), a “pages/models” directory as its data store (CSV/HDF5/Joblib), and utility functions for computing key metrics (performance drift, data drift, data quality, prediction drift, and explanations). The “Jupyter Notebooks” folder houses exploratory and offline analyses but is orthogonal to the core runtime.

##### High-Level Architecture and Components
a. User Interface Layer
- 1_Landing_Page.py
- pages/2_Analysis_Page.py
- pages/Add_Model.py
b. Business Logic & Computation
- utils.py (implements drift detection, metric calculations, explanation generation)
c. Model & Data Storage
- pages/models/… (per-model directories with baseline.csv, model artifacts, ground truths, production-run CSVs)
- pages/output.json, pages/models.json, pages/benchmark.json
- creds.csv (credentials for any remote data sources, if used)
d. Developer/Analyst Notebook Environment
- Jupyter Notebooks (CV.ipynb, Model Monitoring Dashboard.ipynb, NLP Data Quality, etc.)
e. Deployment/Runtime Environment
- Python runtime (per requirements.txt)
- Host (local or cloud VM/container)

##### Relationships & Data Flows
- User → (interacts with) UI Layer → (invokes) Business Logic
- Business Logic → (reads/writes) Model & Data Storage
- Business Logic → (computes) Metrics & Explanations → (returns) to UI Layer
- Notebook Environment ↔ (imports) Business Logic / raw data for offline experimentation

##### Key Architectural Patterns & Principles
- Monolithic, multi-page application (Streamlit-style)
- Separation of Concerns: UI (pages/) vs. logic (utils.py) vs. storage (pages/models/)
- File-based “database” for model artifacts and evaluation data—no heavy RDBMS
- Extensibility: New models drop into pages/models/ with the same directory pattern

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% UI Layer
    subgraph "UI Layer" 
        direction TB
        Landing["1_Landing_Page.py"]:::ui
        Analysis["pages/2_Analysis_Page.py"]:::ui
        AddModel["pages/Add_Model.py"]:::ui
    end

    %% Business Logic
    subgraph "Business Logic & Computation"
        direction TB
        Utils["utils.py"]:::logic
    end

    %% Data Storage
    subgraph "Model & Data Storage"
        direction TB
        ModelsDir["pages/models/"]:::storage
        ModelsJSON["pages/models.json"]:::storage
        BenchmarkJSON["pages/benchmark.json"]:::storage
        OutputJSON["pages/output.json"]:::storage
        Creds["creds.csv"]:::storage
    end

    %% Notebook Environment
    subgraph "Notebook Environment"
        direction TB
        Notebooks["Jupyter Notebooks/"]:::notebook
    end

    %% Deployment/Runtime
    subgraph "Deployment & Runtime"
        direction TB
        Requirements["requirements.txt"]:::runtime
        README["README.md"]:::runtime
    end

    %% Connections
    Landing -->|"invoke UI action"| Utils
    Analysis -->|"compute drift metrics"| Utils
    AddModel -->|"add new model"| Utils

    Utils -->|"read/write model data"| ModelsDir
    Utils -->|"update models index"| ModelsJSON
    Utils -->|"update benchmark data"| BenchmarkJSON
    Utils -->|"output results"| OutputJSON
    Utils -->|"access credentials"| Creds

    ModelsDir -->|"load artifacts & data"| Utils

    Utils -->|"return metrics & plots"| Landing
    Utils -->|"return metrics & plots"| Analysis

    Notebooks <-->|"import utils & raw data"| Utils

    Requirements -->|"defines runtime"| Utils
    Requirements -->|"defines runtime"| Landing
    Requirements -->|"defines runtime"| Analysis
    README -->|"documentation"| Utils

    %% Click Events
    click Landing "https://github.com/akshatmittu/machine-learning-model-reliability-analysis-at-production-level/blob/main/1_Landing_Page.py"
    click Analysis "https://github.com/akshatmittu/machine-learning-model-reliability-analysis-at-production-level/blob/main/pages/2_Analysis_Page.py"
    click AddModel "https://github.com/akshatmittu/machine-learning-model-reliability-analysis-at-production-level/blob/main/pages/Add_Model.py"
    click Utils "https://github.com/akshatmittu/machine-learning-model-reliability-analysis-at-production-level/blob/main/utils.py"
    click ModelsDir "https://github.com/akshatmittu/machine-learning-model-reliability-analysis-at-production-level/tree/main/pages/models/"
    click ModelsJSON "https://github.com/akshatmittu/machine-learning-model-reliability-analysis-at-production-level/blob/main/pages/models.json"
    click BenchmarkJSON "https://github.com/akshatmittu/machine-learning-model-reliability-analysis-at-production-level/blob/main/pages/benchmark.json"
    click OutputJSON "https://github.com/akshatmittu/machine-learning-model-reliability-analysis-at-production-level/blob/main/pages/output.json"
    click Creds "https://github.com/akshatmittu/machine-learning-model-reliability-analysis-at-production-level/blob/main/creds.csv"
    click Notebooks "https://github.com/akshatmittu/machine-learning-model-reliability-analysis-at-production-level/tree/main/Jupyter Notebooks/"
    click Requirements "https://github.com/akshatmittu/machine-learning-model-reliability-analysis-at-production-level/blob/main/requirements.txt"
    click README "https://github.com/akshatmittu/machine-learning-model-reliability-analysis-at-production-level/blob/main/README.md"

    %% Styles
    classDef ui fill:#bbdefb,stroke:#1e88e5;
    classDef logic fill:#c8e6c9,stroke:#388e3c;
    classDef storage fill:#ffe0b2,stroke:#f57c00;
    classDef notebook fill:#eeeeee,stroke:#757575;
    classDef runtime fill:#e1bee7,stroke:#8e24aa;
```
