# suchi0506/housepriceprediction_ml architecture

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

- Interactive diagram: https://gitdiagram.com/suchi0506/housepriceprediction_ml
- Repository: https://github.com/suchi0506/housepriceprediction_ml

## Overview

##### Project type and purpose
- This is a machine-learning pipeline for housing price prediction based on Kaggle’s “Housing Prices” dataset.
- It lives as a Jupyter Notebook (HousingPricesPrediction.ipynb) plus a raw CSV (Housing.csv) and orchestrates data ingestion, cleaning, feature engineering, model training, and evaluation.

##### File structure
- Housing.csv – the raw dataset (source of truth for features and target).
- HousingPricesPrediction.ipynb – the pipeline implementation in notebook form, containing all code cells for loading, preprocessing, modeling, visualization, and evaluation.
- README.md – documents objectives, steps taken, algorithms used, and metrics.

##### README for additional insights
- Preprocessing: one-hot encoding, standardization, multicollinearity checks (VIF), PCA.
- Models trained: Linear Regression, Decision Tree, SVR, KNN, Random Forest, Gradient Boosting.
- Metrics: R², RMSE, MSE, MAE.
- Detecting overfitting and applying regularization.

a. Data Ingestion
– Component: Data Loader
– Input: Housing.csv file (or remote Kaggle URL)
– Output: Raw DataFrame
b. Data Preprocessing
– Component: Cleaner & Encoder
– Tasks: Missing value handling (if any), one-hot encoding for categorical features, feature scaling (standardization)
– Output: Preprocessed DataFrame
c. Multicollinearity & Dimensionality Reduction
– Component: VIF Calculator + PCA Module
– Tasks: Compute VIFs, drop or combine features, transform data via PCA
– Output: Feature matrix ready for modeling
d. Model Training
– Component: Model Trainer
– Sub-components:
- Linear Regression
- Decision Tree Regressor
- SVR
- KNN Regressor
- Random Forest Regressor
- Gradient Boosting Regressor
– Input: Engineered features + target vector
– Output: Fitted model artifacts
e. Model Evaluation
– Component: Evaluator
– Tasks: Compute R², RMSE, MSE, MAE; generate plots (scatter, residuals)
– Output: Metrics table, charts
f. Reporting & Visualization
– Component: Reporting Module
– Tasks: Display visualizations in notebook; compare model performances

##### Architectural patterns and principles
- Linear pipeline (ETL → modeling → evaluation)
- Modular separation: every logical step is its own block
- Reproducibility: each step should be parameterized (e.g., threshold for multicollinearity, PCA components)
- Extensibility: easy to add new models or feature-selection modules

##### Technologies & libraries to annotate
- Python 3.x runtime (Jupyter environment)
- pandas, numpy (data manipulation)
- scikit-learn (encoding, scaling, VIF, PCA, models, metrics)
- matplotlib / seaborn (visualizations)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Data Source
    DataCSV[/"Housing.csv"/]:::data
    DataLoader["Data Loader"]:::pre
    Cleaner["Cleaner & Encoder"]:::pre
    VIFPCA["VIF Calculator + PCA Module"]:::pre
    ModelTrain["Model Trainer"]:::model
    Evaluator["Evaluator"]:::eval
    Reporting["Reporting Module"]:::report

    %% Pipeline Flow
    DataCSV -->|load data| DataLoader
    DataLoader -->|raw → clean| Cleaner
    Cleaner -->|clean → features| VIFPCA
    VIFPCA -->|features → train| ModelTrain
    ModelTrain -->|models → metrics| Evaluator
    Evaluator -->|results → visuals| Reporting

    %% Model Trainer Subcomponents
    subgraph "Model Trainer Components"
        direction TB
        LR["Linear Regression"]:::model
        DT["Decision Tree Regressor"]:::model
        SVR["SVR"]:::model
        KNN["KNN Regressor"]:::model
        RF["Random Forest Regressor"]:::model
        GB["Gradient Boosting Regressor"]:::model
    end

    %% README Link
    READMEMark["README.md"]:::external
    Reporting --> READMEMark

    %% Click Events
    click DataCSV "https://github.com/suchi0506/housepriceprediction_ml/blob/main/Housing.csv"
    click DataLoader "https://github.com/suchi0506/housepriceprediction_ml/blob/main/HousingPricesPrediction.ipynb"
    click Cleaner "https://github.com/suchi0506/housepriceprediction_ml/blob/main/HousingPricesPrediction.ipynb"
    click VIFPCA "https://github.com/suchi0506/housepriceprediction_ml/blob/main/HousingPricesPrediction.ipynb"
    click ModelTrain "https://github.com/suchi0506/housepriceprediction_ml/blob/main/HousingPricesPrediction.ipynb"
    click Evaluator "https://github.com/suchi0506/housepriceprediction_ml/blob/main/HousingPricesPrediction.ipynb"
    click Reporting "https://github.com/suchi0506/housepriceprediction_ml/blob/main/HousingPricesPrediction.ipynb"
    click READMEMark "https://github.com/suchi0506/housepriceprediction_ml/blob/main/README.md"

    %% Styles
    classDef data fill:#c6dbef,stroke:#3182bd,stroke-width:2px;
    classDef pre fill:#deebf7,stroke:#3182bd,stroke-width:2px;
    classDef model fill:#e5f5e0,stroke:#31a354,stroke-width:2px;
    classDef eval fill:#fee6ce,stroke:#e6550d,stroke-width:2px;
    classDef report fill:#fceae8,stroke:#de2d26,stroke-width:2px;
    classDef external fill:#fff7bc,stroke:#fd8d3c,stroke-width:2px,stroke-dasharray: 5 5;
```
