A recent analysis of data from Demographic and Health Surveys conducted between 2021 and 2024 has found that supervised machine-learning models can effectively predict the HIV testing history of women aged 15 to 49 across 13 sub-Saharan African countries. This study emphasized the importance of HIV testing for diagnosis, treatment, and prevention, highlighting significant regional variations in testing history.
The analysis included a pooled sample of 213,169 women, with 111,666—representing 52.4% of respondents—reporting that they had been tested for HIV. However, testing prevalence showed dramatic differences by country, with rates ranging from a mere 17.5% in Madagascar to 94.9% in Lesotho.
Researchers assessed seven supervised machine-learning algorithms, employing three validation strategies. These included a stratified 80:20 random holdout, leave-one-country-out validation to evaluate the model’s geographic transportability, and five-fold primary sampling unit group-disjoint validation to measure performance within distinct local clusters. The study focused on discrimination, classification, and calibration metrics across the models.
The top-performing algorithm, XGBoost, demonstrated the highest area under the receiver operating characteristic curve at 0.923, with a 95% confidence interval of 0.920 to 0.925, during the stratified random holdout testing. It also achieved an overall accuracy of 0.835 and a Brier score of 0.112, indicating strong predictive capabilities when trained and assessed on subsets from the pooled data.
However, the performance of models dropped when assessed through leave-one-country-out validation. In this context, XGBoost and gradient boosting attained a macro-averaged area under the curve of 0.850, with XGBoost achieving a macro-averaged accuracy of 0.705, sensitivity of 0.777, specificity of 0.722, and a Brier score of 0.201. The exclusion of country data as a predictor further reduced the macro-averaged area under the curve to 0.824.
When examining performance across geographic clusters, the supplementary validation indicated that XGBoost achieved a mean area under the curve of 0.865 among the 13 countries evaluated, with a standard deviation of 0.044. The mean Brier score in this validation was 0.111, with a standard deviation of 0.043. Key predictors identified included literacy, contraceptive use, awareness of sexually transmitted infections, age, and education.
Despite these promising results, the authors noted that lower predictive performance in excluded countries points to limitations in geographic transportability and emphasized the need for further validation before these models can be integrated into HIV testing programs. They cautioned against interpreting predictive feature importance as causal.
Research Reference: Wondmeneh, T. G. (2026). “Predicting history of HIV testing among women aged 15–49 years in 13 sub-Saharan African countries using supervised machine learning: a pooled analysis of recent demographic and health surveys (2021–2024).” BMC Women’s Health. https://doi.org/10.1186/s12905-026-05171-x


