# ๐ 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 โฆ