# akshatbindal/ml-regression-project-structured architecture

> Architecture diagram of the GitHub repository akshatbindal/ml-regression-project-structured, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akshatbindal/ml-regression-project-structured
- Repository: https://github.com/akshatbindal/ml-regression-project-structured

## Overview

##### Project type and purpose
- This is a modular ML regression project for predicting student performance.
- It includes both a training pipeline (to process raw data, build and save a model) and a prediction web-service exposing a simple UI.

##### File structure
- Top-level files:
– app.py: Flask web app entry point
– artifacts/: storage for datasets, trained model and preprocessor
– catboost_info/: training logs from CatBoost runs
– notebook/: exploratory and experimental notebooks
– requirements.txt, setup.py: packaging and dependencies
- src/: core Python package
– components/: data_ingestion.py, data_transformation.py, model_trainer.py
– pipeline/: train_pipeline.py (orchestrates ingestion → transform → train), predict_pipeline.py
– exception.py, logger.py, utils.py: cross-cutting infrastructure
- templates/: Jinja2 HTML templates for home and index pages

##### README for additional insights
- Confirms it’s a full pipeline, not just notebooks, following a modular coding paradigm.
- Focus is on training multiple regression models and serving predictions.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        UI["User Interface<br/>templates/home.html<br/>templates/index.html"]:::presentation
        App["Flask App<br/>app.py"]:::logic
    end

    %% Application Logic Layer
    subgraph "Application Logic"
        PredictPipe["Prediction Pipeline<br/>src/pipeline/predict_pipeline.py"]:::logic
        TrainPipe["Training Pipeline<br/>src/pipeline/train_pipeline.py"]:::logic
        Ingest["Data Ingestion<br/>src/components/data_ingestion.py"]:::logic
        Transform["Data Transformation<br/>src/components/data_transformation.py"]:::logic
        Trainer["Model Trainer<br/>src/components/model_trainer.py"]:::logic
    end

    %% Infrastructure Layer
    subgraph "Data & External Services"
        Artifacts["Artifact Store<br/>artifacts/"]:::data
        CatBoost["CatBoost Logs<br/>catboost_info/"]:::data
    end

    %% Cross-Cutting
    Logger["Logger<br/>src/logger.py"]:::logging
    Exception["Exception Handler<br/>src/exception.py"]:::logging

    %% Analytical Sandbox
    Notebook["Analytical Sandbox<br/>notebook/"]:::external

    %% Data Flows and Control Flows
    UI -->|HTTP request| App
    App -->|invoke predict| PredictPipe
    PredictPipe -->|transform input| Transform
    PredictPipe -->|load artifacts| Artifacts
    PredictPipe -->|return prediction| App

    TrainPipe -->|ingest raw data| Ingest
    Ingest -->|read CSV| Artifacts
    TrainPipe -->|transform data| Transform
    TrainPipe -->|train model| Trainer
    Trainer -->|save artifacts| Artifacts

    %% Logging and Exception Handling
    App -->|log/exception| Logger
    App -->|log/exception| Exception
    PredictPipe -->|log/exception| Logger
    PredictPipe -->|log/exception| Exception
    TrainPipe -->|log/exception| Logger
    TrainPipe -->|log/exception| Exception
    Ingest -->|log/exception| Logger
    Transform -->|log/exception| Logger
    Trainer -->|log/exception| Logger

    %% Legend (optional)
    classDef presentation fill:#B0E0E6,stroke:#333,stroke-width:1px
    classDef logic fill:#98FB98,stroke:#333,stroke-width:1px
    classDef data fill:#FFD700,stroke:#333,stroke-width:1px
    classDef logging fill:#FFA07A,stroke:#333,stroke-width:1px
    classDef external fill:#D3D3D3,stroke:#333,stroke-width:1px

    %% Click Events
    click UI "https://github.com/akshatbindal/ml-regression-project-structured/blob/main/templates/home.html"
    click UI "https://github.com/akshatbindal/ml-regression-project-structured/blob/main/templates/index.html"
    click App "https://github.com/akshatbindal/ml-regression-project-structured/blob/main/app.py"
    click PredictPipe "https://github.com/akshatbindal/ml-regression-project-structured/blob/main/src/pipeline/predict_pipeline.py"
    click TrainPipe "https://github.com/akshatbindal/ml-regression-project-structured/blob/main/src/pipeline/train_pipeline.py"
    click Ingest "https://github.com/akshatbindal/ml-regression-project-structured/blob/main/src/components/data_ingestion.py"
    click Transform "https://github.com/akshatbindal/ml-regression-project-structured/blob/main/src/components/data_transformation.py"
    click Trainer "https://github.com/akshatbindal/ml-regression-project-structured/blob/main/src/components/model_trainer.py"
    click Artifacts "https://github.com/akshatbindal/ml-regression-project-structured/tree/main/artifacts/"
    click Logger "https://github.com/akshatbindal/ml-regression-project-structured/blob/main/src/logger.py"
    click Exception "https://github.com/akshatbindal/ml-regression-project-structured/blob/main/src/exception.py"
    click CatBoost "https://github.com/akshatbindal/ml-regression-project-structured/tree/main/catboost_info/"
```
