# hamailshahbaz/home-price-prediction architecture

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

- Interactive diagram: https://gitdiagram.com/hamailshahbaz/home-price-prediction
- Repository: https://github.com/hamailshahbaz/home-price-prediction

## Overview

This is a house-price prediction product with two user-facing valuation paths: a Streamlit dashboard and a REST API. Both accept property details, assemble engineered model features, run a trained regressor, and return a dollar estimate. The separate training workflow ingests and cleans housing data, engineers features, trains and evaluates a model, then saves artifacts consumed by inference. The API’s request/response schema is also a distinct boundary. Runtime wiring for the dashboard and several README capabilities is documented, but its unsampled implementation details are not expanded.

Main entry points: [`src/train.py`](https://github.com/hamailshahbaz/home-price-prediction/blob/main/src/train.py) (Training orchestration), [`api/main.py`](https://github.com/hamailshahbaz/home-price-prediction/blob/main/api/main.py) (REST prediction API), [`app/streamlit_app.py`](https://github.com/hamailshahbaz/home-price-prediction/blob/main/app/streamlit_app.py) (Valuation dashboard), [`models/xgboost_housing_model.pkl`](https://github.com/hamailshahbaz/home-price-prediction/blob/main/models/xgboost_housing_model.pkl) (Model artifacts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_training["Model training"]
  node_ingestion["Load and clean<br/>[data_pipeline.py]"]
  node_features["Feature engineering"]
  node_trainingrun["Training orchestration<br/>[train.py]"]
  node_modeling["XGBoost training<br/>[models.py]"]
  node_evaluation["Model evaluation<br/>[evaluate.py]"]
end

subgraph group_serving["Valuation serving"]
  node_api_schema["Prediction schemas<br/>[schemas.py]"]
  node_api["REST prediction API<br/>[main.py]"]
end

subgraph group_ui["User interfaces"]
  node_dashboard["Valuation dashboard<br/>[streamlit_app.py]"]
end

node_user(("Property user"))
node_rawdata["Housing data<br/>[data.csv]"]
node_artifacts["Model artifacts"]
node_processed["Processed housing data"]
node_model_features["Feature metadata<br/>[model_features.pkl]"]
node_estimate["Price estimate"]

node_user -->|"enters property"| node_dashboard
node_dashboard -->|"loads model"| node_artifacts
node_dashboard -->|"loads columns"| node_model_features
node_dashboard -->|"loads location data"| node_processed
node_dashboard -->|"returns valuation"| node_estimate
node_user -->|"submits property"| node_api_schema
node_api_schema -->|"validates request"| node_api
node_api -->|"loads model"| node_artifacts
node_api -->|"loads columns"| node_model_features
node_api -->|"loads location data"| node_processed
node_api -->|"returns valuation"| node_estimate
node_rawdata -->|"supplies records"| node_trainingrun
node_trainingrun -->|"calls cleaning"| node_ingestion
node_trainingrun -->|"builds features"| node_features
node_trainingrun -->|"trains and saves"| node_modeling
node_trainingrun -->|"evaluates model"| node_evaluation
node_trainingrun -->|"writes dataset"| node_processed
node_modeling -->|"serializes model"| node_artifacts
node_features -->|"imports cleaning helpers"| node_ingestion

click node_rawdata "https://github.com/hamailshahbaz/home-price-prediction/blob/main/data/data.csv"
click node_ingestion "https://github.com/hamailshahbaz/home-price-prediction/blob/main/src/data_pipeline.py"
click node_features "https://github.com/hamailshahbaz/home-price-prediction/blob/main/src/feature_engineering.py"
click node_trainingrun "https://github.com/hamailshahbaz/home-price-prediction/blob/main/src/train.py"
click node_modeling "https://github.com/hamailshahbaz/home-price-prediction/blob/main/src/models.py"
click node_evaluation "https://github.com/hamailshahbaz/home-price-prediction/blob/main/src/evaluate.py"
click node_artifacts "https://github.com/hamailshahbaz/home-price-prediction/blob/main/models/xgboost_housing_model.pkl"
click node_processed "https://github.com/hamailshahbaz/home-price-prediction/blob/main/data/processed/cleaned_housing_data.csv"
click node_api_schema "https://github.com/hamailshahbaz/home-price-prediction/blob/main/api/schemas.py"
click node_api "https://github.com/hamailshahbaz/home-price-prediction/blob/main/api/main.py"
click node_dashboard "https://github.com/hamailshahbaz/home-price-prediction/blob/main/app/streamlit_app.py"
click node_model_features "https://github.com/hamailshahbaz/home-price-prediction/blob/main/models/model_features.pkl"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ingestion,node_features,node_trainingrun,node_modeling,node_evaluation,node_user toneBlue
class node_api_schema,node_api toneAmber
class node_dashboard toneMint
class node_rawdata,node_processed,node_model_features toneTeal
class node_artifacts,node_estimate toneIndigo
```

## Components

### Model training

- [Load and clean](https://github.com/hamailshahbaz/home-price-prediction/blob/main/src/data_pipeline.py): `src/data_pipeline.py`
- [Feature engineering](https://github.com/hamailshahbaz/home-price-prediction/blob/main/src/feature_engineering.py): `src/feature_engineering.py`
- [Training orchestration](https://github.com/hamailshahbaz/home-price-prediction/blob/main/src/train.py): `src/train.py`
- [XGBoost training](https://github.com/hamailshahbaz/home-price-prediction/blob/main/src/models.py): `src/models.py`
- [Model evaluation](https://github.com/hamailshahbaz/home-price-prediction/blob/main/src/evaluate.py): `src/evaluate.py`

### Valuation serving

- [Prediction schemas](https://github.com/hamailshahbaz/home-price-prediction/blob/main/api/schemas.py): `api/schemas.py`
- [REST prediction API](https://github.com/hamailshahbaz/home-price-prediction/blob/main/api/main.py): `api/main.py`

### User interfaces

- [Valuation dashboard](https://github.com/hamailshahbaz/home-price-prediction/blob/main/app/streamlit_app.py): `app/streamlit_app.py`

### Other components

- **Property user**
- [Housing data](https://github.com/hamailshahbaz/home-price-prediction/blob/main/data/data.csv): `data/data.csv`
- [Model artifacts](https://github.com/hamailshahbaz/home-price-prediction/blob/main/models/xgboost_housing_model.pkl): `models/xgboost_housing_model.pkl`
- [Processed housing data](https://github.com/hamailshahbaz/home-price-prediction/blob/main/data/processed/cleaned_housing_data.csv): `data/processed/cleaned_housing_data.csv`
- [Feature metadata](https://github.com/hamailshahbaz/home-price-prediction/blob/main/models/model_features.pkl): `models/model_features.pkl`
- **Price estimate**

## Connections

- Property user → Valuation dashboard: enters property (evidence: `README.md`)
- Valuation dashboard → Model artifacts: loads model (evidence: `app/streamlit_app.py`)
- Valuation dashboard → Feature metadata: loads columns (evidence: `app/streamlit_app.py`)
- Valuation dashboard → Processed housing data: loads location data (evidence: `app/streamlit_app.py`)
- Valuation dashboard → Price estimate: returns valuation (evidence: `app/streamlit_app.py`)
- Property user → Prediction schemas: submits property (evidence: `README.md`)
- Prediction schemas → REST prediction API: validates request (evidence: `api/main.py`)
- REST prediction API → Model artifacts: loads model (evidence: `api/main.py`)
- REST prediction API → Feature metadata: loads columns (evidence: `api/main.py`)
- REST prediction API → Processed housing data: loads location data (evidence: `api/main.py`)
- REST prediction API → Price estimate: returns valuation (evidence: `api/main.py`)
- Housing data → Training orchestration: supplies records (evidence: `README.md`)
- Training orchestration → Load and clean: calls cleaning (evidence: `src/train.py`)
- Training orchestration → Feature engineering: builds features (evidence: `src/train.py`)
- Training orchestration → XGBoost training: trains and saves (evidence: `src/train.py`)
- Training orchestration → Model evaluation: evaluates model (evidence: `src/train.py`)
- Training orchestration → Processed housing data: writes dataset (evidence: `src/train.py`)
- XGBoost training → Model artifacts: serializes model (evidence: `src/models.py`)
- Feature engineering → Load and clean: imports cleaning helpers (evidence: `src/feature_engineering.py`)
