# nehaal-patel/machine-learning-regression-models architecture

> Architecture diagram of the GitHub repository nehaal-patel/machine-learning-regression-models, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nehaal-patel/machine-learning-regression-models
- Repository: https://github.com/nehaal-patel/machine-learning-regression-models

## Overview

##### Project type and purpose
- This repository is a set of educational machine-learning regression pipelines implemented as Jupyter notebooks.
- Its purpose is to demonstrate end-to-end regression problems (Boston Housing, Diamond Price, Advertising Sales) using scikit-learn techniques.

##### File structure
- Top-level:
- Three folders (Advertising_Sales_Dataset, “Boston Housing Prices”, Diamond_Price) each containing:
– A CSV dataset
– A Jupyter notebook implementing the latest ML pipeline
– (Boston_Housing_Price folder includes an older “rgex1.ipynb” as a learning checkpoint)
- One standalone notebook (Life-expectancy.ipynb) and README.md
- No backend servers, no web frontends—this is purely a data-science/ML repo.

##### Key README insights
- Each project uses the same modeling framework:
- Data ingestion → preprocessing → train/test split → model training across several regressors (Linear, Lasso, Ridge, SGD, MLP) → evaluation/visualization.
- Emphasis on evolving from simple linear regression to a reusable pipeline.

1. Data Layer
- Raw CSV files (e.g., Advertising.csv, boston_data.csv, diamonds.csv)
2. Notebook Environment
- Jupyter Notebook server/session where code is executed
3. ML Framework
- Python environment (Anaconda/venv)
- Libraries: pandas, numpy, scikit-learn, matplotlib/seaborn
4. Pipeline Stages (for each project)
i. Data Loader
ii. Data Preprocessor (cleaning, encoding, scaling)
iii. Model Trainer (fit multiple regressors)
iv. Evaluator & Visualizer (metrics, plots)
5. Outputs
- Model performance reports (RMSE, R²)
- Plots and charts embedded in the notebook
b. Relationships & interactions
- Jupyter Notebook mediates between the raw data and the Python/ML libraries
c. Architectural patterns/design principles
- Modular pipeline: each stage (ingest, preprocess, train, evaluate) as a reusable block
- Separation of concerns: data in one folder, code in notebooks, results in outputs
- Iterative experimentation: multiple notebook versions (e.g., “rgex1.ipynb” → “Boston_Housing_Price_ML.ipynb”)
d. Technologies/frameworks
- Jupyter for orchestration
- Python 3.x environment (requirements: pandas, numpy, scikit-learn, matplotlib/seaborn)
- CSV data stores

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Layer
    subgraph "Data Layer"
        direction TB
        A1["Advertising.csv"]:::data
        A2["boston_data.csv"]:::data
        A3["diamonds.csv"]:::data
    end

    %% ML Framework
    subgraph "ML Framework"
        direction TB
        FE["Python Environment"]:::env
        FB["pandas, numpy"]:::env
        FC["scikit-learn"]:::env
        FD["matplotlib/seaborn"]:::env
    end

    %% Advertising Sales Pipeline
    subgraph "Advertising Sales Pipeline"
        direction TB
        AN["Advertising_Sales_ML.ipynb"]:::notebook
        AL["Data Loader"]:::process
        AP["Preprocessor"]:::process
        AT["Model Trainer"]:::process
        AE["Evaluator & Visualizer"]:::process
        AO["Notebook Output"]:::output
    end

    %% Boston Housing Pipeline
    subgraph "Boston Housing Pipeline"
        direction TB
        BN1["rgex1.ipynb"]:::notebook
        BN2["Boston_Housing_Price_ML.ipynb"]:::notebook
        BL["Data Loader"]:::process
        BP["Preprocessor"]:::process
        BT["Model Trainer"]:::process
        BE["Evaluator & Visualizer"]:::process
        BO["Notebook Output"]:::output
    end

    %% Diamond Price Pipeline
    subgraph "Diamond Price Pipeline"
        direction TB
        DN["DiamondPrice.ipynb"]:::notebook
        DL["Data Loader"]:::process
        DP["Preprocessor"]:::process
        DT["Model Trainer"]:::process
        DE["Evaluator & Visualizer"]:::process
        DO["Notebook Output"]:::output
    end

    %% Life Expectancy Pipeline
    subgraph "Life Expectancy Pipeline"
        direction TB
        LN["Life-expectancy.ipynb"]:::notebook
        LL["Data Loader"]:::process
        LP["Preprocessor"]:::process
        LT["Model Trainer"]:::process
        LE["Evaluator & Visualizer"]:::process
        LO["Notebook Output"]:::output
    end

    %% Connections Advertising
    A1 --> AL
    AN --> AL
    AL --> AP
    AP --> AT
    AT --> AE
    AE --> AO
    AN --> AO
    AN --> FE

    %% Connections Boston
    A2 --> BL
    BN1 --> BL
    BN2 --> BL
    BL --> BP
    BP --> BT
    BT --> BE
    BE --> BO
    BN2 --> BO
    BN1 --> BP
    BN2 --> FE

    %% Connections Diamond
    A3 --> DL
    DN --> DL
    DL --> DP
    DP --> DT
    DT --> DE
    DE --> DO
    DN --> DO
    DN --> FE

    %% Connections Life Expectancy
    LN --> LL
    LL --> LP
    LP --> LT
    LT --> LE
    LE --> LO
    LN --> LO
    LN --> FE

    %% Project Documentation
    RD["README.md"]:::docs
    RD --> FE

    %% Click Events
    click A1 "https://github.com/nehaal-patel/machine-learning-regression-models/blob/master/Advertising_Sales_Dataset/Advertising.csv"
    click A2 "https://github.com/nehaal-patel/machine-learning-regression-models/blob/master/Boston Housing Prices/boston_data.csv"
    click A3 "https://github.com/nehaal-patel/machine-learning-regression-models/blob/master/Diamond_Price/diamonds.csv"
    click AN "https://github.com/nehaal-patel/machine-learning-regression-models/blob/master/Advertising_Sales_Dataset/Advertising_Sales_ML.ipynb"
    click BN2 "https://github.com/nehaal-patel/machine-learning-regression-models/blob/master/Boston Housing Prices/Boston_Housing_Price_ML.ipynb"
    click BN1 "https://github.com/nehaal-patel/machine-learning-regression-models/blob/master/Boston Housing Prices/rgex1.ipynb"
    click DN "https://github.com/nehaal-patel/machine-learning-regression-models/blob/master/Diamond_Price/DiamondPrice.ipynb"
    click LN "https://github.com/nehaal-patel/machine-learning-regression-models/blob/master/Life-expectancy.ipynb"
    click RD "https://github.com/nehaal-patel/machine-learning-regression-models/blob/master/README.md"

    %% Styles
    classDef data fill:#cce5ff,stroke:#004085,color:#004085,shape:cylinder;
    classDef env fill:#e2e3e5,stroke:#6c757d,color:#383d41;
    classDef notebook fill:#d4edda,stroke:#155724,color:#155724,rx:10,ry:10;
    classDef process fill:#fff3cd,stroke:#856404,color:#856404;
    classDef output fill:#f8d7da,stroke:#721c24,color:#721c24;
    classDef docs fill:#e2f0d9,stroke:#2f6627,color:#2f6627;
```
