# Explainable AI–Driven Comparative Analysis of Machine Learning Models for Predicting HIV Viral Nonsuppression in Ugandan Patients: Retrospective Cross-Sectional Study

**Authors:** Francis Ngema, Albert Whata, Micheal O Olusanya, Siyabonga Mhlongo

PMC · DOI: 10.2196/68196 · JMIR AI · 2026-01-06

## TL;DR

This study uses machine learning and explainable AI to predict and understand factors causing HIV viral nonsuppression in Ugandan patients.

## Contribution

The novel contribution is applying XAI techniques to an optimized ML model to identify and interpret key predictors of HIV viral nonsuppression in a Ugandan cohort.

## Key findings

- XGBoost model achieved an AUC of 0.80 in predicting viral nonsuppression.
- Adherence assessment over the preceding 3 months was the most influential predictor.
- XAI methods provided transparent interpretations at both population and individual levels.

## Abstract

HIV viral suppression is essential for improving health outcomes and reducing transmission rates among people living with HIV. In Uganda, where HIV/AIDS is a major public health concern, machine learning (ML) models can predict viral suppression effectively. However, the limited use of explainable artificial intelligence (XAI) methods affects model transparency and clinical utility.

This study aimed to develop and compare ML models for predicting viral nonsuppression in Ugandan people living with HIV on antiretroviral therapy (ART), and then systematically apply comprehensive XAI techniques to the best-performing model to identify key predictors and demonstrate interpretability at both population and individual patient levels.

We retrospectively analyzed clinical and demographic data from 1101 Ugandan people living with HIV on ART at the HIV clinic in Muyembe Health Centre IV between June 2016 and April 2018, focusing on predicting viral nonsuppression (viral load >1000 copies per milliliter). The dataset was divided into model-building (training: 80%) and validation (test: 20%) sets. To address class imbalance, the synthetic minority over-sampling technique was applied. For global explanation, 8 ML algorithms—logistic regression, stacked ensemble, random forest, support vector machines, extreme gradient boosting (XGBoost), k-nearest neighbors, naïve Bayes, and artificial neural networks—were compared. Model performance was evaluated using metrics such as accuracy, precision, recall, F1-score, Cohen κ, and area under the curve (AUC). For local explanation, individual conditional expectation plots, Shapley Additive Explanations (SHAP), breakdown, and SHAP force plots were used to provide insights into predictions for individual patients.

The XGBoost ensemble model demonstrated superior performance with an accuracy of 0.89, precision of 0.59, recall of 0.65, and AUC of 0.80. The model achieved high specificity (0.93) and moderate sensitivity, yielding a Cohen κ of 0.55 and F1-score of 0.62, indicating good discriminative ability for viral nonsuppression prediction. SHAP feature importance analysis identified adherence assessment over the preceding 3 months as the most influential predictor of viral nonsuppression, followed by age group, urban residence, and duration on ART. Local SHAP consistently demonstrated that poor adherence was the primary driver of both correctly identified nonsuppressed cases and false positive predictions, reinforcing adherence as the critical determinant of treatment outcomes.

The XGBoost model demonstrated optimal performance for predicting viral nonsuppression among Ugandan people living with HIV on ART, achieving an AUC of 0.80. Comprehensive XAI analysis identified adherence assessment as the primary predictor, followed by age group, residence type, and ART duration. XAI methods provided transparent interpretation of model predictions at both population and individual patient levels, enabling identification of key risk factors for targeted clinical interventions in resource-limited settings.

## Linked entities

- **Species:** Homo sapiens (taxon 9606)

## Full-text entities

- **Diseases:** XAI (MESH:C538243), HIV (MESH:D015658)
- **Species:** Human immunodeficiency virus 1 (no rank) [taxon 11676], Homo sapiens (human, species) [taxon 9606]

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC12820540/full.md

## Figures

8 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12820540/full.md

## References

49 references — full list in the complete paper: https://tomesphere.com/paper/PMC12820540/full.md

---
Source: https://tomesphere.com/paper/PMC12820540