# naeem1144/greatertorontoareahousepriceprediction architecture

> Architecture diagram of the GitHub repository naeem1144/greatertorontoareahousepriceprediction, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/naeem1144/greatertorontoareahousepriceprediction
- Repository: https://github.com/naeem1144/greatertorontoareahousepriceprediction

## Overview

##### Main Components

a) Data Layer:
- Input Data Source: "GTA_HomePrice_History.csv"
- Data features (Geographic, Sales, Listing, Market, Temporal, Building Type)

b) Data Preprocessing Pipeline:
- KNN Imputation for missing values
- One-hot encoding for categorical variables
- Feature scaling/normalization
- Train-test split

c) Model Layer (parallel branches):
- Branch 1: Linear Regression
- Branch 2: Decision Tree Regressor
- Branch 3: Gradient Boosting Regressor (with cross-validation)
- Branch 4: Artificial Neural Network (PyTorch)
- BatchNorm layers
- Early stopping mechanism

d) Evaluation Layer:
- Metrics calculation (R2, MSE, MAE)
- Cross-validation results
- Visualization components

##### Specific Elements

- Feedback loops for cross-validation and early stopping
- Input/output specifications at each stage
- Technology labels (Python, PyTorch, Scikit-learn)

##### Component Relationships

- Parallel model training paths
- Evaluation feedback loops
- Model comparison workflow

##### Technical Details to Emphasize

- Data preprocessing pipeline steps
- Model architectures (especially ANN layers)
- Cross-validation workflow
- Evaluation metrics flow

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Data Layer
    subgraph Data
        InputData["Input Data Source<br/>GTA_HomePrice_History.csv"]:::data
        Features["Features<br/>Geographic | Sales | Listing<br/>Market | Temporal | Building Type"]:::data
    end

    %% Preprocessing Layer
    subgraph Preprocessing
        KNN["KNN Imputation"]:::preprocess
        OneHot["One-hot Encoding"]:::preprocess
        Scale["Feature Scaling"]:::preprocess
        Split["Train-Test Split"]:::preprocess
    end

    %% Model Layer
    subgraph Models
        direction TB
        LR["Linear Regression"]:::model
        DT["Decision Tree<br/>Regressor"]:::model
        GB["Gradient Boosting<br/>Regressor"]:::model
        
        subgraph ANN["Artificial Neural Network"]
            direction TB
            BatchNorm["Batch Normalization"]:::model
            EarlyStop["Early Stopping"]:::model
        end
    end

    %% Evaluation Layer
    subgraph Evaluation
        Metrics["Model Metrics<br/>R2 | MSE | MAE"]:::eval
        CrossVal["Cross-Validation<br/>Results"]:::eval
        Viz["Visualization<br/>Components"]:::eval
    end

    %% Dependencies and Documentation
    Dependencies["Project Dependencies"]:::docs
    Documentation["Project Documentation"]:::docs

    %% Connections
    InputData --> Features
    Features --> KNN
    KNN --> OneHot
    OneHot --> Scale
    Scale --> Split
    
    Split --> LR
    Split --> DT
    Split --> GB
    Split --> BatchNorm
    
    BatchNorm --> EarlyStop
    
    LR --> Metrics
    DT --> Metrics
    GB --> Metrics
    EarlyStop --> Metrics
    
    Metrics --> CrossVal
    CrossVal --> Viz

    %% Click Events
    click InputData "https://github.com/Naeem1144/GreaterTorontoAreaHousePricePrediction/blob/main/GTA_HomePrice_History.csv"
    click KNN "https://github.com/Naeem1144/GreaterTorontoAreaHousePricePrediction/blob/main/GreaterTorontoAreaHousePricePrediction.ipynb"
    click OneHot "https://github.com/Naeem1144/GreaterTorontoAreaHousePricePrediction/blob/main/GreaterTorontoAreaHousePricePrediction.ipynb"
    click Scale "https://github.com/Naeem1144/GreaterTorontoAreaHousePricePrediction/blob/main/GreaterTorontoAreaHousePricePrediction.ipynb"
    click Split "https://github.com/Naeem1144/GreaterTorontoAreaHousePricePrediction/blob/main/GreaterTorontoAreaHousePricePrediction.ipynb"
    click LR "https://github.com/Naeem1144/GreaterTorontoAreaHousePricePrediction/blob/main/GreaterTorontoAreaHousePricePrediction.ipynb"
    click DT "https://github.com/Naeem1144/GreaterTorontoAreaHousePricePrediction/blob/main/GreaterTorontoAreaHousePricePrediction.ipynb"
    click GB "https://github.com/Naeem1144/GreaterTorontoAreaHousePricePrediction/blob/main/GreaterTorontoAreaHousePricePrediction.ipynb"
    click BatchNorm "https://github.com/Naeem1144/GreaterTorontoAreaHousePricePrediction/blob/main/GreaterTorontoAreaHousePricePrediction.ipynb"
    click EarlyStop "https://github.com/Naeem1144/GreaterTorontoAreaHousePricePrediction/blob/main/GreaterTorontoAreaHousePricePrediction.ipynb"
    click Metrics "https://github.com/Naeem1144/GreaterTorontoAreaHousePricePrediction/blob/main/GreaterTorontoAreaHousePricePrediction.ipynb"
    click CrossVal "https://github.com/Naeem1144/GreaterTorontoAreaHousePricePrediction/blob/main/GreaterTorontoAreaHousePricePrediction.ipynb"
    click Viz "https://github.com/Naeem1144/GreaterTorontoAreaHousePricePrediction/blob/main/GreaterTorontoAreaHousePricePrediction.ipynb"
    click Dependencies "https://github.com/Naeem1144/GreaterTorontoAreaHousePricePrediction/blob/main/requirements.txt"
    click Documentation "https://github.com/Naeem1144/GreaterTorontoAreaHousePricePrediction/blob/main/README.md"

    %% Styles
    classDef data fill:#a8d1f0,stroke:#333,stroke-width:2px
    classDef preprocess fill:#90EE90,stroke:#333,stroke-width:2px
    classDef model fill:#FFB347,stroke:#333,stroke-width:2px
    classDef eval fill:#DDA0DD,stroke:#333,stroke-width:2px
    classDef docs fill:#F0E68C,stroke:#333,stroke-width:2px
```
