# π Egypt Real Estate Price Predictor
> An intelligent full-stack ML system that predicts real estate prices across Egypt based on 19,000+ real market listings β with SHAP explainability, FastAPI backend, and a bilingual React frontend.
---
## πΈ Screenshots
### Light Mode (Arabic)
### Dark Mode (English)
### SHAP Explainability
### API Documentation
---
## π― What Makes This Project Different
Most real estate price predictors just give you a number. This system:
- β
**Explains WHY** β SHAP values show which factors (location, size, type) drove the prediction
- β
**Real Market Data** β 19,321 cleaned listings from Property Finder Egypt
- β
**Price Range** β not just one number, but a confidence interval
- β
**Market Comparison** β compare your property vs. area average price/mΒ²
- β
**Bilingual UI** β full Arabic (RTL) and English (LTR) support
- β
**Dark / Light Mode** β persisted across sessions
---
## π§± Tech Stack
| Layer | Technology |
|---|---|
| Data | 19,321 real listings from Property Finder Egypt |
| ML Model | XGBoost (RΒ² = 0.74, MAE β 4.9M EGP) |
| Hyperparameter Tuning | Optuna (50 trials) |
| Explainability | SHAP via XGBoost native `pred_contribs` |
| Backend | FastAPI + Uvicorn |
| Frontend | React + Vite |
| Styling | CSS3 with CSS Variables (Dark/Light themes) |
| Language | Arabic/English toggle with RTL/LTR support |
---
## π Model Performance
| Metric | Value |
|---|---|
| RΒ² Score | **0.74** |
| MAE | **~4.9M EGP** |
| Training samples | 15,456 |
| Test samples | 3,865 |
| Hyperparameter tuning | Optuna (50 trials, 3-fold CV) |
**Top features by SHAP importance:**
1. Area price per mΒ² (target-encoded) β 36.8%
2. Property type β 20.4%
3. Size (mΒ²) β 11.1%
---
## π API Endpoints
```
GET /health β Health check
GET /areas β List of governorates, areas, property types
POST /predict β Predict price with confidence range
POST /explain β SHAP explanation of prediction
GET /market-anal β¦