A MACHINE LEARNING APPROACH TO TAX OBLIGATION CLASSIFICATION FROM BANK TRANSACTION RECORDS: A CASE STUDY OF NIGERIA
# TaxSense: Multi-Class Tax Obligation Classification
**Nigerian Bank Transaction Narration Classifier**
MSc Data Science Capstone — Rome Business School Nigeria (Alessandro Group 13)
TaxSense is a machine learning pipeline that predicts which Nigerian tax obligation applies to a bank transaction — **WHT**, **PIT**, **CIT**, **STAMP**, or **NON_TAXABLE** — using both the transaction's structured attributes (amount, bank, account type, state, etc.) and its free-text narration. The project follows the six phases of the **CRISP-DM framework** and is grounded in the Nigeria Tax Act 2025 and WHT Regulations 2024.
## Repository Contents
| File / Folder | Description |
|---|---|
| `TaxSense_Project_Analysis.ipynb` | Full end-to-end ML pipeline notebook (CRISP-DM phases 1–6) |
| `taxsense_transactions_data.csv` | 20,000-row synthetic Nigerian bank transaction dataset (22 columns) |
| `taxsense_final_model.joblib` | Saved best-performing model pipeline (preprocessing + classifier bundled) |
| `taxsense_label_encoder.joblib` | Label encoder for models requiring integer-encoded targets |
| `taxsense_feature_list.joblib` | Expected feature schema, for building downstream apps/UIs |
| `README.md` | This file |
## Problem Statement
Given a bank transaction's attributes and narration text, classify it into one of five tax obligation categories. This is a five-class classification problem with meaningful class imbalance (NON_TAXABLE accounts for ~48% of records, CIT for only ~7%).
## Dataset
- **20,000 rows, 22 columns** of synthetic Nigerian bank transaction data
- Features span categorical (bank name, account type, state, counterparty type), numeric (transaction amount, year, month, quarter), and free text (narration)
- Class distribution: NON_TAXABLE (48.2%), PIT (24.4%), WHT (10.6%), STAMP (9.4%), CIT (7.3%)
- Leakage columns (`label_reason`, `wht_rate_applicable`, `noise_type`, `is_noisy_record`, `transaction_id`, `transaction_date`) are identified and dropped before m …