Production-ready AI system for predicting Egyptian real estate prices using Machine Learning, geolocation intelligence, FastAPI, Streamlit, MLflow, and Docker.
# Egypt Real Estate Price Prediction
End-to-end ML system that predicts apartment prices in Egypt. Includes web
scraping, data cleaning, feature engineering, geolocation features, MLflow
experiment tracking, a FastAPI prediction service, and a Streamlit dashboard.
> **Note:** This project intentionally **does not ship Docker**. Run it directly
> with Python.
---
## Architecture
Rendered PNG (`python scripts/render_architecture.py` -> `docs/architecture.png`):
```mermaid
flowchart TD
SCRAPE["Scrapers OLX/Dubizzle · Aqarmap (+ synthetic fallback)"] --> RAW["data/raw/*.csv"]
RAW --> CLEAN["Cleaning types · dups · outliers"]
CLEAN --> FEAT["Feature Engineering ppm · density · luxury"]
FEAT --> GEO["Geolocation Nominatim · metro km"]
GEO --> FEATURES["features.csv"]
FEATURES --> TRAIN["Training Linear · RF · XGBoost · CatBoost"]
TRAIN --> MLFLOW["MLflow Tracking params · metrics · model"]
TRAIN --> MODEL["best_model.pkl"]
MODEL --> API["FastAPI / · /health · /predict"]
API --> STREAMLIT["Streamlit Dashboard form · charts · map"]
MODEL --> POWERBI["Power BI exported dataset"]
```
---
## Setup
```bash
python -m venv .venv
.\.venv\Scripts\activate # Windows PowerShell
# source .venv/bin/activate # macOS / Linux
pip install -r requirements.txt
copy .env.example .env # then edit if needed
```
Python 3.11 is recommended.
---
## Quickstart (synthetic data path)
The fastest way to a runnable system. No scraping or internet required.
```bash
python -m src.utils.sample_data # data/raw/properties_raw.csv
python -m src.preprocessing.clean_data # data/processed/properties_clean.csv
python -m src.preprocessing.feature_engineering # data/processed/features.csv
python -m src.models.train # models/best_model.pkl
```
Then run the API and the dashboard in two terminals:
```bash
# Terminal 1 — FastAPI
python -m src.api.app
# OR: uvicorn src.api.app:app --host 0.0.0.0 --port 8000
# Terminal 2 — S …