End-to-End MLOps pipeline for predicting housing prices in Nigeria using Flask and Docker.
---
title: Nigeria Housing Price Predictor
emoji: 🏠
colorFrom: green
colorTo: yellow
sdk: docker
pinned: false
---
# Nigeria Housing Price Predictor (End-to-End MLOps)
An end-to-end **Machine Learning Microservice** that predicts housing prices in Nigeria using real-world data.
This project demonstrates **production-grade MLOps practices**, including automated data pipelines, containerization, CI integration, and model deployment.
---
## System Architecture
The project follows a modular MLOps architecture, separating:
- **Experimentation (Model Development)**
- **Production (API Serving & Deployment)**
```mermaid
graph LR
A[Raw Data CSV] -->|ETL Pipeline| B(Preprocessing & Cleaning)
B -->|Train| C{Random Forest Model}
C -->|Serialize| D[Model Artifact .pkl]
D -->|Load| E[Flask Microservice]
E -->|Dockerize| F[Production Container]
subgraph CI_CD [GitHub Actions Pipeline]
G[Push Code] --> H[Install Dependencies]
H --> I[Run Pytest]
I -->|Pass| J[Build Docker Image]
end
````
---
## 🛠 Tech Stack
### **Core**
* Python 3.12
* Pandas
* Scikit-Learn (Pipelines)
### **API**
* Flask (RESTful Microservice)
### **Containerization**
* Docker (Multi-stage builds, Slim images)
### **CI/CD**
* GitHub Actions (Automated Testing)
### **Environment**
* WSL 2 (Ubuntu Linux)
---
## 🚀 Quick Start
You can run this project using **Docker (recommended)** or directly via **Python**.
---
### **Option 1: Using Docker (Production Simulation)**
Ensure Docker Desktop is running.
```bash
# 1. Build the lightweight container
docker build -t housing-predictor .
# 2. Run the container (Maps port 5000)
docker run -p 5000:5000 housing-predictor
```
---
### **Option 2: Local Python Environment (Development)**
```bash
# 1. Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate
# 2. Install dependencies
pip install -r requirements.txt
# 3. Tra …