An end-to-end data science pipeline for Zambian retail analytics — featuring synthetic data generation, EDA, ARIMA & XGBoost demand forecasting, RFM customer segmentation, stockout risk detection, and an executive BI dashboard. Built with Python, Pandas, Scikit-learn, XGBoost, Statsmodels & Plotly
# 🛒 Zambia National Retail Intelligence Platform
### *An End-to-End Data Science Project | Retail Analytics · Demand Forecasting · Business Intelligence*
Author: Given Chinyama |
Date: June 2026 |
LinkedIn |
GitHub
---
## 📌 Overview
Zambia's retail sector is undergoing rapid transformation — driven by urbanisation, mobile money adoption, and a growing middle class across cities like Lusaka, Kitwe, Ndola, and Livingstone. Yet the vast majority of retailers still operate without data-driven insight, relying on intuition over analytics.
This project addresses that gap by building a **National Retail Intelligence Platform** — a production-grade, end-to-end data science pipeline that simulates, cleans, analyses, forecasts, and visualises Zambian retail data across 7 cities, 8 store chains, and 24 product categories.
The platform is designed to serve three distinct audiences:
| Audience | Use Case |
|---|---|
| 🏪 Retailers & FMCG distributors | Reduce stockouts, optimise inventory, plan promotions |
| 📊 Data scientists & analysts | Reproducible forecasting and segmentation pipelines |
| 🏛️ Government & trade policy teams | National retail price monitoring and trade analytics |
---
## ✨ Key Features
- **Realistic synthetic dataset** — 80,000 transactions across 7 Zambian cities, population-weighted and seasonally adjusted, all priced in Zambian Kwacha (ZMW)
- **Dual forecasting models** — ARIMA for seasonal trend interpretation and XGBoost for high-accuracy daily demand prediction
- **RFM customer segmentation** — Recency, Frequency, and Monetary analysis combined with K-Means clustering to identify Champions, Loyal Regulars, New Customers, and At-Risk segments
- **Stockout and overstock risk detection** — Rule-based flags combined with Z-score anomaly detection on daily revenue streams
- **Executive BI dashboard** — A 9-panel interactive Plotly dashboard covering revenue, margins, seasonality, promotions, and Yo …