ML model to predict real estate prices in Algeria using Ouedkniss data
# π Algerian Real Estate Price Predictor
A machine learning system that predicts real estate prices in Algeria, built end-to-end from raw data collection to a deployed, explainable web app.
## Live Demo
Try the app here
## Overview
This project predicts property prices across Algeria using listings data, and explains *why* the model makes each prediction using SHAP. It covers the full ML lifecycle: data collection, cleaning, feature engineering, model comparison, explainability, and deployment.
## Key Results
| Model | MAE (DA) | RΒ² |
|---|---|---|
| Linear Regression | 1,065,916 | 0.508 |
| Random Forest | 802,865 | 0.614 |
| Gradient Boosting | 905,697 | 0.607 |
| **XGBoost (best)** | **809,961** | **0.624** |
Trained on 15,532 cleaned listings after removing outliers and non-Algerian entries from a raw dataset of 64,099 records.
## SHAP Feature Importance
Listing type (sale vs. rental) and location in Algiers emerged as the dominant price drivers β consistent with market intuition, while also revealing that the absence of structural features (surface area, floor number) limits the model's explanatory power within a given city.
## Tech Stack
- **Data**: pandas, Selenium (initial scraping attempt), Kaggle dataset
- **ML**: scikit-learn, XGBoost
- **Explainability**: SHAP
- **App**: Streamlit
- **Language**: Python
## Project Structure
```
βββ data/
β βββ raw/ # original data
β βββ processed/ # cleaned, feature-engineered data
βββ src/
β βββ scraper.py # Selenium-based scraper (Ouedkniss)
β βββ preprocess.py # cleaning & feature engineering
β βββ train.py # model training, comparison & SHAP
βββ models/ # saved model, explainer, feature names
βββ reports/ # SHAP visualizations
βββ app.py # Streamlit web app
βββ requirements.txt
```
## What I Learned
- Built a Selenium-based scraper and diagnosed why it failed against Ouedkn β¦