# faizan-fayaz-10/house-price-prediction. architecture

> Architecture diagram of the GitHub repository faizan-fayaz-10/house-price-prediction., generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/faizan-fayaz-10/house-price-prediction.
- Repository: https://github.com/faizan-fayaz-10/house-price-prediction.

## Overview

##### Main Components
a. Data Source
- Boston Housing dataset (loaded via scikit-learn)
b. Data Processing & EDA
- Loading & cleaning raw data
- Generating exploratory visuals (correlation heatmap)
c. Model Training
- Linear Regression implementation (scikit-learn)
d. Evaluation & Visualization
- Calculating R², RMSE
- Plotting predicted vs. actual prices
e. Model Persistence
- Saving the trained model to `house_price_model.pkl` using joblib
f. Outputs
- Saved images (`correlation_heatmap.png`, `predictions.png`)
- Persisted model file

##### Relationships & Data Flow
- Data Source → Data Processing & EDA
- Processed Data → Model Training
- Trained Model + Test Data → Evaluation & Visualization
- Trained Model → Model Persistence
- EDA & Evaluation steps → Output files

##### Architectural Patterns & Principles
- Linear, pipeline-style flow—each stage feeds the next
- Separation of concerns: ingestion, analysis, training, evaluation, persistence
- Reproducibility—model persistence for deployment or later inference

##### Key Technologies & Frameworks
- Python 3
- scikit-learn (data loading + LinearRegression)
- pandas / numpy (data manipulation)
- matplotlib / seaborn (visualizations)
- joblib (model serialization)

##### Putting It All Together
[ Dataset (sklearn) ]
↓
[ Data Processing & EDA (pandas, seaborn) ]
↓
[ Model Training (LinearRegression) ]
↓
[ Evaluation & Visualization (metrics, matplotlib) ]
↓
[ Model Persistence (joblib) ]
↓
[ Output Files: .png visuals, .pkl model ]

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Data Source
    DS["Boston Housing Dataset\n(sklearn)"]:::data
    %% Processing & EDA
    EDA["Data Processing & EDA\n(pandas, seaborn)"]:::module
    %% Model Training
    MT["Model Training\n(LinearRegression)"]:::module
    %% Evaluation & Visualization
    EV["Evaluation & Visualization\n(metrics, matplotlib)"]:::module
    %% Model Persistence
    MP["Model Persistence\n(joblib)"]:::module

    %% Outputs
    subgraph "Outputs"
        Heatmap["correlation_heatmap.png"]:::output
        Predictions["predictions.png"]:::output
        ModelFile["house_price_model.pkl"]:::output
    end

    %% Documentation & Dependencies
    subgraph "Documentation"
        README["README.md"]:::docs
        Req["requirements.txt"]:::docs
    end

    %% Flow
    DS -->|"raw DataFrame"| EDA
    EDA -->|"cleaned DataFrame"| MT
    MT -->|"trained Model"| EV
    EV -->|"evaluation Results"| MP

    %% Outputs connections
    EDA -->|"heatmap png"| Heatmap
    EV -->|"prediction plot"| Predictions
    MP -->|".pkl"| ModelFile

    %% Click Events
    click DS "https://github.com/faizan-fayaz-10/house-price-prediction./blob/main/model.py"
    click EDA "https://github.com/faizan-fayaz-10/house-price-prediction./blob/main/model.py"
    click MT "https://github.com/faizan-fayaz-10/house-price-prediction./blob/main/model.py"
    click EV "https://github.com/faizan-fayaz-10/house-price-prediction./blob/main/model.py"
    click MP "https://github.com/faizan-fayaz-10/house-price-prediction./blob/main/model.py"
    click Heatmap "https://github.com/faizan-fayaz-10/house-price-prediction./blob/main/correlation_heatmap.png"
    click Predictions "https://github.com/faizan-fayaz-10/house-price-prediction./blob/main/predictions.png"
    click ModelFile "https://github.com/faizan-fayaz-10/house-price-prediction./blob/main/house_price_model.pkl"
    click README "https://github.com/faizan-fayaz-10/house-price-prediction./blob/main/README.md"
    click Req "https://github.com/faizan-fayaz-10/house-price-prediction./blob/main/requirements.txt"

    %% Styles
    classDef data fill:#bbf,stroke:#333,stroke-width:1px
    classDef module fill:#f9f,stroke:#333,stroke-width:1px
    classDef output fill:#bfb,stroke:#333,stroke-width:1px
    classDef docs fill:#ffb,stroke:#333,stroke-width:1px
```
