A look at which diabetes and hypertension patients skip their medications, and what that costs — built on public, de-identified pharmacy claims data. The dashboard and models both point at the same story: adherence isn't random, and one of the five models tested didn't actually work, which turned out to be worth reporting rather than hiding.
The source is a public, de-identified dataset of pharmacy claims (Kanyongo, Moyo, Ezugwu & Fonou Dombeu, Mendeley Data, DOI 10.17632/zkp7sbbx64.2, CC0 license) — a hypertension table of roughly 218,816 records and a diabetes table of roughly 52,616 records, each with 41 columns. Raw claims data is not analysis-ready: it was merged with coverage and complication reference tables (neurology, ophthalmology, physician visits, dialysis) down to a final analytical set of 24,084 patients and 11 predictor features, organized into a star schema — a fact table of patient claims joined to dimension tables for patients, coverage, and complications — the same kind of structure a BI tool can query efficiently and a model can consume directly.
That schema underpins a four-page Power BI dashboard that moves through the problem in order: risk identification, segmentation, intervention prioritization, then predictive analytics — rather than putting every chart on one page and letting the viewer figure out the story themselves.
59.85% of patients (14,415 of 24,084) were non-adherent to their prescribed medication. Hypertension patients made up 80.05% of the population, and the 50–59 age band was the largest single cohort at 26.65%. The number worth sitting with: non-adherent patients carried roughly 2.5× the average annual claims cost of adherent ones — non-adherence isn't just a clinical problem, it shows up directly in cost.
Five classifiers were benchmarked on an 80/20 split — a 4,817-patient held-out test set. Four of them landed in a reasonable 78.66%–81.98% accuracy range. The fifth didn't work at all.
| Model | Accuracy | Precision | Recall | F1 |
|---|---|---|---|---|
| Logistic Regression | 59.85%* | 0.000 | 0.000 | 0.000 |
| Decision Tree | 78.66% | — | — | — |
| Extra Trees | ≈80% | — | — | — |
| Random Forest | ≈81% | — | — | — |
| Gradient Boosting | 81.98% | 0.738 | 0.855 | 0.792 |
*Logistic Regression's accuracy is the majority-class baseline, not a meaningful score — see above. Precision/recall/F1 weren't separately reported for every mid-table model in the original analysis; the comparison focuses on accuracy for those and full metrics for the champion.
Feature importance from the Random Forest model was dominated by two variables: total claim units (42.97%) and annual claim amount (33.71%) — together over 76% of the model's predictive power. Age was a distant third at 14.76%, and every demographic or coverage variable individually contributed under 2%. In plain terms: claims volume and cost history predict future adherence far better than who the patient is.
No trained model or app code survives from this project's original working session — only the Power BI files and the feature-importance outputs. A rebuilt version, if it happens, would mean retraining the Gradient Boosting model from the same public dataset rather than reviving anything that already exists.