Machine learning pipeline to detect tax fraud using Tunisia Ministry of Finance data
# π§Ύ Tunisia Tax Fraud Detection
> Detecting tax fraud in Tunisia using supervised machine learning on real Ministry of Finance data β achieving **6th place out of 286 teams** worldwide on the Zindi leaderboard.
---
## π Achievement
Ranked **#6 globally out of 286 participants** in the Tunisian Fraud Detection Challenge on Zindi.
---
## π Objective
- Improve tax fraud detection accuracy using ML
- Handle missing data and outliers effectively
- Create advanced engineered features for better performance
- Reach the lowest possible **Root Mean Squared Error (RMSE)**
---
## π Data Source
This project is based on the Tunisian Fraud Detection Challenge on Zindi
which provides the data and problem definition used here.
---
## π Project Structure
| File | Description |
|------|-------------|
| `tunisia_tax_fraud_model.ipynb` | Complete pipeline from loading data to model evaluation |
| `Report.pdf` | Final project summary and presentation |
| `Submission_Enhanced.csv` | Final prediction submission file |
| `README.md` | Project documentation |
---
## π§ͺ Model & Techniques
- **Model**: LightGBM (fast gradient boosting)
- **Validation**: 7-Fold Cross-Validation
- **Encoding**: CatBoostEncoder + Target Encoding
- **Feature Engineering**:
- Ratio and log-ratio features
- Categorical interactions
- Missing value indicators
- Aggregated statistics
---
## π Dataset Overview
| File | Description |
|------|-------------|
| `Train.csv` | 15,000 rows with features and a `target` column |
| `Test.csv` | 5,000 rows with features only |
| `submission.csv` | Sample format for submission |
---
## π Evaluation Metric
- **Root Mean Squared Error (RMSE)**
- Lower RMSE = better model performance
---
## β
Results
| Metric | Value |
|--------|-------|
| Baseline RMSE | 7.0856 |
| Final RMSE (OOF) | **5.377** |
| Improvement | β ~24% |
| **Leaderboard Rank** | **π₯ 6th / 286** |
---
## π Visualizations
The notebook includes:
- Target distribution plots
- Missing val β¦