# aman-mitra/house-pricing-prediction-model architecture

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

- Interactive diagram: https://gitdiagram.com/aman-mitra/house-pricing-prediction-model
- Repository: https://github.com/aman-mitra/house-pricing-prediction-model

## Overview

##### Project type and purpose
- This is a machine-learning-powered web application: a Flask-based service that exposes a house-pricing prediction model (regression) via a simple HTML front end.
- The Jupyter notebook (Linear_Reg.ipynb) contains the offline model training; the app uses pickled artifacts (regmodel.pkl, scaling.pkl) for inference.

##### File structure
- app.py: Flask application entry point, handles HTTP requests, loads scaler and model, renders templates.
- templates/home.html: front-end form for collecting input features; displays predicted price.
- regmodel.pkl & scaling.pkl: serialized scikit-learn model and standard scaler.
- Linear_Reg.ipynb: data exploration and model training pipeline.
- requirements.txt: Python dependencies (Flask, scikit-learn, etc.).
- Dockerfile: containerizes the Flask app for local testing or deployment.
- Procfile: declares Heroku process type (web: gunicorn app:app).
- .github/workflows/main.yaml: CI pipeline (build, test, container build, deploy).

##### Final advice
- Be detailed: include each file/artifact group (templates, pickles, Dockerfile, Procfile, workflows).
- Both the runtime request flow and the code-to-deploy pipeline.
- Keep it clear: group related elements, label data formats (HTTP, JSON, pickle), and use consistent iconography for services.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Runtime Layers
    subgraph "Runtime Environment"
        direction TB
        Browser["Browser UI"]:::frontend
        Flask["Flask Web Server"]:::backend
        subgraph "ML Inference Module"
            direction TB
            Scaler["Scaler (scaling.pkl)"]:::ml
            Model["Regression Model (regmodel.pkl)"]:::ml
        end
    end

    %% Development Artifacts
    subgraph "Development Artifacts"
        direction TB
        Notebook["Model Training Notebook"]:::dev
        Requirements["Dependencies (requirements.txt)"]:::dev
        README["Project Documentation"]:::docs
    end

    %% CI/CD and Deployment
    subgraph "CI/CD & Deployment"
        direction TB
        GitHub["GitHub Repository"]:::cicd
        Actions["GitHub Actions (CI/CD)"]:::cicd
        Docker["Docker Container Build"]:::infra
        Heroku["Heroku Dyno"]:::infra
        Procfile["Heroku Config (Procfile)"]:::infra
    end

    %% Runtime Flow
    Browser -->|"HTTP POST: input features"| Flask
    Flask -->|"load scaler, transform"| Scaler
    Scaler -->|"scaled data"| Model
    Model -->|"predicted price"| Flask
    Flask -->|"HTTP RESPONSE: predicted price"| Browser

    %% CI/CD Flow
    GitHub -->|"on push"| Actions
    Actions -->|"build image"| Docker
    Docker -->|"deploy image"| Heroku
    Heroku --> Procfile

    %% Artifact Links
    Flask --> Requirements
    Flask --> Docker
    GitHub --> README
    GitHub --> Notebook

    %% Click Events
    click Browser "https://github.com/aman-mitra/house-pricing-prediction-model/blob/main/templates/home.html"
    click Flask "https://github.com/aman-mitra/house-pricing-prediction-model/blob/main/app.py"
    click Scaler "https://github.com/aman-mitra/house-pricing-prediction-model/blob/main/scaling.pkl"
    click Model "https://github.com/aman-mitra/house-pricing-prediction-model/blob/main/regmodel.pkl"
    click Notebook "https://github.com/aman-mitra/house-pricing-prediction-model/blob/main/Linear_Reg.ipynb"
    click Requirements "https://github.com/aman-mitra/house-pricing-prediction-model/blob/main/requirements.txt"
    click Docker "https://github.com/aman-mitra/house-pricing-prediction-model/tree/main/Dockerfile"
    click Procfile "https://github.com/aman-mitra/house-pricing-prediction-model/tree/main/Procfile"
    click Actions "https://github.com/aman-mitra/house-pricing-prediction-model/blob/main/.github/workflows/main.yaml"
    click README "https://github.com/aman-mitra/house-pricing-prediction-model/blob/main/README.md"

    %% Styles
    classDef frontend fill:#ACE7EF,stroke:#067E9E,color:#000;
    classDef backend fill:#B2F7EF,stroke:#009688,color:#000;
    classDef ml fill:#FFF59D,stroke:#FBC02D,color:#000;
    classDef dev fill:#E0E0E0,stroke:#9E9E9E,color:#000;
    classDef cicd fill:#FFD54F,stroke:#FFB300,color:#000;
    classDef infra fill:#CE93D8,stroke:#8E24AA,color:#000;
    classDef docs fill:#FFCCBC,stroke:#F4511E,color:#000;
```
