An explainable multi-outcome machine learning framework for personalized clinical decision support in HIV care using routine electronic health records in Zambia
Machine learning (ML) applied to routine HIV electronic health records (EHRs) could support personalized decision-making, but existing evidence is limited by information leakage, evaluation on the facilities used for training, and limited interpretability. We developed and evaluated an explainable multi-outcome framework using routine EHR data from Zambia. We used 246,053 patient records from six public facilities in Lusaka District to predict three 12-month outcomes among people living with HIV: recorded TB treatment (TB12m), interruption in treatment (IIT12m), and recorded unsuppressed viral load (UVL12m). Predictors were derived only from information available at the index date. Models were trained on four facilities ( n = 171,547) and evaluated on two held-out facilities ( n = 74,506). A stacked ensemble of logistic regression, random forest, and XGBoost was compared with each base model, and operating thresholds were selected on a validation partition of the training facilities. We report AUC-ROC and AUC-PR with bootstrap confidence intervals, DeLong tests, calibration, clinical-utility metrics, decision curves on recalibrated probabilities, and SHAP (Shapley Additive Explanations) explanations. For TB12m, discrimination was moderate (AUC-ROC 0.707, 95% CI 0.703–0.710), with sensitivity 0.68 and precision 0.56 at the operating threshold. For IIT12m and UVL12m, ranking was fair to good (AUC-ROC 0.839, 95% CI 0.822–0.856; and 0.778, 95% CI 0.763–0.794), but precision at the operating threshold was 0.05 and 0.09. Decision curves showed net benefit for TB12m at threshold probabilities of 0.27 or above, and only a small net benefit for the rare outcomes at low thresholds. Discrimination differed between the two test facilities (TB12m AUC-ROC 0.649 vs. 0.754). An ablation analysis showed that the apparent importance of education for the rare outcomes came from its missing-value indicator rather than from educational attainment. The framework achieved moderate performance for recorded TB treatment but provided only low-precision screening signals for the two rare outcomes, and performance varied between facilities within the same district. Because model signal partly reflects documentation practice, improving data quality and prospective, multi-site, calibrated evaluation are prerequisites for any clinical use.
Authors
- Jacob Mutale (ORCID: https://orcid.org/0000-0002-8914-0645)
- Innocent Chiboma (ORCID: https://orcid.org/0009-0000-5776-6443)
- Chiyaba Njovu
- Andrew Kashoka (ORCID: https://orcid.org/0000-0003-4581-7842)
- Aaron Zimba (ORCID: https://orcid.org/0000-0002-2587-106X)
- Mwansa Lumpa (ORCID: https://orcid.org/0009-0000-2306-6318)
- Joe Phiri (ORCID: https://orcid.org/0009-0002-0336-6852)
- Mulenga Chiwele
- Trevor Sinkala
Institutions
- Centre for Infectious Disease Research in Zambia (ZM)
- Ministry of Health (ZM)
- Zambia Centre for Accountancy Studies (ZM)
Publication Details
- Journal
- BMC Medical Informatics and Decision Making
- Published
- 2026-11-30
- DOI
- https://doi.org/10.1186/s12911-026-04014-x
- Primary Topic
- Machine Learning in Healthcare
- Type
- article
- Field-Weighted Citation Impact
- 0.00