Next Article in Journal
Risk of Incidence and Lethality by Etiology of Severe Acute Respiratory Syndrome in Hospitalized Children Under 1 Year of Age in Brazil in 2024: A Cross-Sectional Study
Previous Article in Journal
Immunological and Virological Responses in Patients with Monoinfection and Coinfection with Hepatitis B and C Viruses in the Brazilian Amazon
Previous Article in Special Issue
Unmasking Bacillus Calmette–Guérin Immune Reconstitution Inflammatory Syndrome in a Perinatal HIV Transmission—A Case Report
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
This is an early access version, the complete PDF, HTML, and XML versions will be available soon.
Article

The Application of Machine Learning Algorithms to Predict HIV Testing Using Evidence from the 2002–2017 South African Adult Population-Based Surveys: An HIV Testing Predictive Model †

by
Musa Jaiteh
1,*,
Edith Phalane
1,
Yegnanew A. Shiferaw
2,
Haruna Jallow
3 and
Refilwe Nancy Phaswana-Mafuya
1
1
South African Medical Research Council/University of Johannesburg Pan African Centre for Epidemics Research Extramural Unit, Faculty of Health Sciences, University of Johannesburg, Johannesburg 2006, South Africa
2
Department of Statistics, Faculty of Science, University of Johannesburg, Johannesburg 2006, South Africa
3
Department of Mathematics (Data Science Option), Pan African University Institute for Basic Sciences, Technology and Innovation, Juja P.O. Box 62000 00200, Kenya
*
Author to whom correspondence should be addressed.
This article is a revised and expanded version of a paper entitled: The Application of Machine Learning Algorithms to Predict HIV Testing Among South African Adult Population: Evidence from the 2017 Population-Based Survey. BMCProceedings, University of South Carolina, Columbia, SC, USA, 13 February 2025.
Trop. Med. Infect. Dis. 2025, 10(6), 167; https://doi.org/10.3390/tropicalmed10060167
Submission received: 10 April 2025 / Revised: 9 June 2025 / Accepted: 10 June 2025 / Published: 14 June 2025
(This article belongs to the Special Issue HIV Testing and Antiretroviral Therapy)

Abstract

There is a significant portion of the South African population with unknown HIV status, which slows down epidemic control despite the progress made in HIV testing. Machine learning (ML) has been effective in identifying individuals at higher risk of HIV infection, for whom testing is strongly recommended. However, there are insufficient predictive models to inform targeted HIV testing interventions in South Africa. By harnessing the power of supervised ML (SML) algorithms, this study aimed to identify the most consistent predictors of HIV testing in repeated adult population-based surveys in South Africa. The study employed four SML algorithms, namely, decision trees, random forest, support vector machines (SVM), and logistic regression, across the five cross-sectional cycles of the South African National HIV Prevalence, Incidence, and Behavior and Communication Survey (SABSSM) datasets. The Human Science Research Council (HSRC) conducted the SABSSM surveys and made the datasets available for this study. Each dataset was split into 80% training and 20% testing sets with a 5-fold cross-validation technique. The random forest outperformed the other models across all five datasets with the highest accuracy (80.98%), precision (81.51%), F1-score (80.30%), area under the curve (AUC) (88.31%), and cross-validation average (79.10%) in the 2002 data. Random forest achieved the highest classification performance across all the dates, especially in the 2017 survey. SVM had a high recall (89.12% in 2005, 86.28% in 2008) but lower precision, leading to a suboptimal F1-score in the initial analysis. We applied a soft margin to the SVM to improve its classification robustness and generalization, but the accuracy and precision were still low in most surveys, increasing the chances of misclassifying individuals who tested for HIV. Logistic regression performed well in terms of accuracy = 72.75, precision = 73.64, and AUC = 81.41 in 2002, and the F1-score = 73.83 in 2017, but its performance was somewhat lower than that of the random forest. Decision trees demonstrated moderate accuracy (73.80% in 2002) but were prone to overfitting. The topmost consistent predictors of HIV testing are knowledge of HIV testing sites, being a female, being a younger adult, having high socioeconomic status, and being well-informed about HIV through digital platforms. Random forest’s ability to analyze complex datasets makes it a valuable tool for informing data-driven policy initiatives, such as raising awareness, engaging the media, improving employment outcomes, enhancing accessibility, and targeting high-risk individuals. By addressing the identified gaps in the existing healthcare framework, South Africa can enhance the efficacy of HIV testing and progress towards achieving the UNAIDS 2030 goal of eradicating AIDS.
Keywords: HIV; AIDS; HIV testing; machine learning; predictive model; predictors; support vector machine; decision tree; random forest; logistic regression; South Africa; SABSSM; HSRC HIV; AIDS; HIV testing; machine learning; predictive model; predictors; support vector machine; decision tree; random forest; logistic regression; South Africa; SABSSM; HSRC

Share and Cite

MDPI and ACS Style

Jaiteh, M.; Phalane, E.; Shiferaw, Y.A.; Jallow, H.; Phaswana-Mafuya, R.N. The Application of Machine Learning Algorithms to Predict HIV Testing Using Evidence from the 2002–2017 South African Adult Population-Based Surveys: An HIV Testing Predictive Model. Trop. Med. Infect. Dis. 2025, 10, 167. https://doi.org/10.3390/tropicalmed10060167

AMA Style

Jaiteh M, Phalane E, Shiferaw YA, Jallow H, Phaswana-Mafuya RN. The Application of Machine Learning Algorithms to Predict HIV Testing Using Evidence from the 2002–2017 South African Adult Population-Based Surveys: An HIV Testing Predictive Model. Tropical Medicine and Infectious Disease. 2025; 10(6):167. https://doi.org/10.3390/tropicalmed10060167

Chicago/Turabian Style

Jaiteh, Musa, Edith Phalane, Yegnanew A. Shiferaw, Haruna Jallow, and Refilwe Nancy Phaswana-Mafuya. 2025. "The Application of Machine Learning Algorithms to Predict HIV Testing Using Evidence from the 2002–2017 South African Adult Population-Based Surveys: An HIV Testing Predictive Model" Tropical Medicine and Infectious Disease 10, no. 6: 167. https://doi.org/10.3390/tropicalmed10060167

APA Style

Jaiteh, M., Phalane, E., Shiferaw, Y. A., Jallow, H., & Phaswana-Mafuya, R. N. (2025). The Application of Machine Learning Algorithms to Predict HIV Testing Using Evidence from the 2002–2017 South African Adult Population-Based Surveys: An HIV Testing Predictive Model. Tropical Medicine and Infectious Disease, 10(6), 167. https://doi.org/10.3390/tropicalmed10060167

Article Metrics

Back to TopTop