Predicting residential property prices in Tunisia using machine learning. The dataset was synthetically generated to reflect real listings from platforms such as tayara.tn and mubawab.tn, covering 35 Tunisian cities with realistic price ranges, missing values, and outliers.
# Tunisian House Price Prediction
Predicting residential property prices in Tunisia using machine learning.
This project tackles the challenge of estimating real estate prices across 35 Tunisian cities based on property characteristics. It includes data cleaning, feature engineering, and model training/evaluation to identify the most significant drivers of property value in the Tunisian housing market.
## 📊 Dataset
- **Data File:** `tunisia_house_prices.csv`
- **Description:** The dataset was synthetically generated to reflect real listings from platforms such as *tayara.tn* and *mubawab.tn*, covering 35 Tunisian cities. It mimics real-world data with realistic price ranges, missing values, and outliers.
## 🎯 Objective
- **Target Variable:** `price` (in Tunisian Dinar - TND)
- **Goal:** Build a robust machine learning regression model to predict the price of a house.
## 📏 Evaluation Metrics
The models are assessed based on:
- **MAE (Mean Absolute Error):** Chosen for its direct interpretability in TND (shows average error amount).
- **R² (Coefficient of Determination):** Shows the proportion of variance in the dependent variable that is predictable from the independent variables.
## 🏆 Key Findings & Results
**Best Model:** **XGBoost**
- **Performance:** MAE = ~100,234 TND | R² = ~0.65
### Feature Importance & Insights:
1. **Location Tier:** The strongest predictor of price, confirming that geography drives the Tunisian real estate market more than the physical property features.
2. **Size / Surface Area:** The second most important feature, exhibiting a non-linear relationship (price per m² decreases for very large properties).
3. **Floor × Elevator Interaction:** Very meaningful feature. High floors *without* an elevator negatively impact the price, while high floors *with* an elevator command a premium.
4. **Age:** Raw construction year alone has low predictive power.
## ⚠️ Limitations
- **Synthetic Data:** The dataset is synthetic and modeled after r …