Nigeria's first open-source Automated Valuation Model. XGBoost trained on 1,635 scraped PropertyPro listings. MdAPE 28.4%. Live FastAPI REST API.
# Nigeria Property AVM — Automated Valuation Model
> ## Nigeria's first open-source Automated Valuation Model for residential property.
> Built entirely from scraped data, deployed as a live REST API.
## The Problem
Nigeria has no open land registry. No public transaction database. No Zillow.
When a buyer, seller, bank, or investor needs to value a Nigerian property, they hire a human surveyor, a process that takes days and costs ₦50,000–₦200,000, with no transparency on how the number was reached.
This project changes that.
## What I Built
A full end-to-end machine learning pipeline that:
1. Scrapes live property listings from PropertyPro.ng (1,940 listings collected in V1; expanded to 4,143 in V2)
2. Cleans messy, inconsistent Nigerian property data (prices in mixed formats, unstandardised locations)
3. Engineers Nigerian-specific features — LGA-level price encoding, C of O status, BQ presence, premium area flags, LGA quality scores
4. Trains Ridge regression (baseline) and XGBoost (main model)
5. Deploys the model as a production REST API with confidence intervals and automatic documentation
## Live Demo
```bash
curl -X POST
localhost \
-H "Content-Type: application/json" \
-d '{
"bedrooms": 4,
"bathrooms": 4,
"lga": "Lekki",
"state": "Lagos",
"prop_type": "House",
"has_cof_o": 1,
"has_bq": 1,
"has_pool": 0,
"is_furnished": 0,
"is_serviced": 0,
"is_newly_built": 0,
"is_gated": 0
}'
```
**Response:**
```json
{
"estimated_value_ngn": 391014048,
"estimated_value_usd": 244383.78,
"confidence_range_ngn": {
"low": 312811238,
"high": 469216857
},
"lga": "Lekki",
"state": "Lagos"
}
```
## Model Performance (V1)
| Metric | Ridge (Baseline) | XGBoost (Final) | Improvement |
|---|---|---|---|
| MAE | ₦212,938,822 | ₦195,281,484 | -8.3% |
| RMSE | ₦417,689,904 | ₦398,752,440 | -4.5% |
| MAPE | 59.5% | 50.9% | -8.6pp |
| **MdAPE** | **34.1%** | **28.4%** | **-5.7pp** |
> **Why MdAPE?** Nigerian property data contains extreme outliers. Med …