# Nigeria IDP Displacement Prediction (Machine Learning)
A machine learning project that predicts key drivers of internal displacement in Nigeria using IOM Displacement Tracking Matrix (DTM) data from the Humanitarian Data Exchange (HDX).
This project builds an end-to-end pipeline covering:
data cleaning, merging multi-source assessments, exploratory analysis, feature engineering, handling class imbalance, model training, and evaluation.
---
## Project Summary
Internal displacement in Nigeria is driven largely by conflict-related factors, alongside communal clashes and natural disasters. Humanitarian response is often reactive, so this project explores whether displacement drivers can be predicted from demographic and contextual indicators to support earlier planning.
**Task:** Multi-class classification of displacement drivers:
- **Insurgency**
- **Communal Clash**
- **Natural Disaster**
**Models evaluated:**
- Logistic Regression
- Random Forest
- XGBoost (best overall in this evaluation)
**Key metrics used:**
- Macro F1-score (primary)
- Balanced accuracy
- Confusion matrix + classification report
---
## Data Source
Data is derived from the **International Organization for Migration (IOM) Displacement Tracking Matrix (DTM)** published via the **Humanitarian Data Exchange (HDX)**.
> Note: The raw datasets are **not included** in this repository.
> Please download them from HDX/IOM DTM and place them in the `data/` folder as described below.
---
## Repository Structure
```text
nigeria-idp-displacement-prediction/
│── notebooks/
│ └── Nigeria_Immigration.ipynb
│── data/ # ignored by git (place raw files here)
│── outputs/ # optional saved models
│── outputs/ # optional saved charts
│── requirements.txt
│── .gitignore
│── README.md
```
## Reproducibility
- Random seeds are fixed where applicable to support reproducible results.
- Results may vary slightly across environments due to library version differences.
## Selected Visuali …