# 💊 Pharma Supply Chain Monitor — Cameroon
An interactive Streamlit dashboard that applies machine learning and text mining to public pharmaceutical supply chain data for Cameroon — predicting stockout risk, flagging anomalous deliveries, forecasting import demand, and mining counterfeit-drug news coverage.
> CEC420 Data Mining Project · CT23A126
## Overview
Cameroon's pharmaceutical supply chain faces recurring stockouts, weak last-mile logistics, and a persistent counterfeit drug problem. This project brings together five public/derived datasets — USAID GHSC-PSM delivery records, MINSANTE stockout data, CEIC import statistics, and news-sourced counterfeit incident reports — into a single dashboard with four machine learning models behind it.
## Features
The app is organized into five tabs:
| Tab | What it does |
|---|---|
| 📊 **Dashboard** | KPI overview: stockout events by region, counterfeit incidents by year, drug category breakdown, severity distribution, and feature importance driving stockout risk |
| 🔮 **Stockout Predictor** | Interactive form — pick a region, drug category, programme, year, quarter, and logistics conditions to get a live stockout probability from a trained Random Forest, plus model performance metrics (accuracy, precision, recall, F1, confusion matrix) |
| 🚨 **Anomaly Detection** | Isolation Forest flags suspicious deliveries in unlabelled supply chain records, visualized via PCA projection, with a table of flagged deliveries and their anomaly scores |
| 📈 **Import Forecast** | Polynomial regression trained on historical CEIC import data (1995–2018), validated on 2019–2023, and projected out to 2030 |
| 📝 **Text Mining** | TF-IDF + Porter stemming on counterfeit-drug news headlines to surface top terms, drug types mentioned, geographic distribution, and counterfeit type breakdown |
## Models used
- **Random Forest Classifier** — stockout risk prediction (region, drug category, programme, logistics gap, pre/post-3PL era)
- **Isolat …