# Tunisian Real Estate MLOps — Apartment Price Prediction
> A fully automated, production-grade MLOps pipeline that wakes up every morning at 03:00 UTC, checks whether the Tunisian real estate market has new listings, scrapes only what is new, enriches it with geographic data, retrains a price-prediction model if the data changed, promotes the best model to production, and backs everything up to Google Drive — with no human intervention required.
**Data source:** mubawab.tn
**Target:** Apartment sale prices in TND (Tunisian Dinar)
**Champion model:** Ridge Regression — R² ≈ 0.77 · average error ±22% (Can be changed if the data changes)
**Stack:** Python · Airflow · DVC · MLflow · Docker · Scikit-learn · BeautifulSoup · Geopy · Nominatim
---
## Table of contents
1. Project overview
2. Repository structure
3. Architecture — the four layers
4. Infrastructure layer — Docker
5. Scheduling layer — Apache Airflow
6. ML reproducibility layer — DVC
7. Experiment tracking layer — MLflow
8. Pipeline scripts — role of every file
9. Notebooks — EDA and modeling in detail
10. Airflow task logs — how output flows
11. Data artifact lineage
12. Complete execution timeline
13. Key design decisions and why
14. How to run the project
15. Project results summary
---
## 1. Project overview
This project predicts the sale price of Tunisian apartments from data scraped from mubawab.tn. It is not just a machine learning notebook — it is a complete MLOps system built on four distinct, non-overlapping layers that automate the entire lifecycle from raw web data to a promoted production model.
The pipeline runs on a fixed daily schedule. On each run it:
1. Checks whether Mubawab has new apartment listings since the last run
2. Scrapes only the new listings using a content-based deduplication fingerprint
3. Geocodes only the new rows using the Nominatim API and computes 14 geographic features per row
4. Runs the EDA and modeling notebooks headlessly via `nbconvert`
5. Compares the newly …