Machine learning models for HIV status classification under class imbalance using discrimination and probability calibration
Year: 2026
Type: article
Abstract: Human immunodeficiency virus (HIV) remains an important public-health challenge in sub-Saharan Africa, including Ethiopia. Machine-learning approaches may support HIV risk stratification; however, severe class imbalance can adversely affect minority-class detection and the reliability of predicted probabilities. This study evaluated the discrimination, performance, and probability calibration of multiple machine-learning classifiers for HIV-status classification using the 2016 Ethiopian Demographic and Health Survey (EDHS) HIV testing data. The dataset was divided into 70% training and 30% independent testing sets. Eight important predictors were selected using feature-selection techniques. Multiple machine-learning classifiers, including Random Forest (RF), Classification and Regression Tree (CART), k-Nearest Neighbours (KNN), Support Vector Machine (SVM), Logistic Regression (LR), and Naïve Bayes (NB), were evaluated. SMOTE was applied exclusively within the training data to address class imbalance. Model performance was assessed using accuracy, sensitivity, specificity, balanced accuracy, ROC-AUC, and Matthews correlation coefficient (MCC). Probability calibration was additionally evaluated using calibration slope and intercept, Brier score, log loss, and reliability diagrams, with Platt scaling used for post-hoc recalibration. Overall accuracy alone provided an inadequate assessment of model performance under severe class imbalance. KNN achieved high accuracy (0.94) but very low sensitivity (0.05), balanced accuracy (0.50), and MCC (0.002). NB showed the highest sensitivity (0.77) and ROC-AUC (0.72), while LR demonstrated a comparatively balanced performance, with sensitivity of 0.69 and specificity of 0.68. SMOTE did not consistently improve generalization to the naturally distributed test set and substantially reduced RF sensitivity from 0.46 to 0.23 and ROC-AUC from 0.71 to 0.63, while CART sensitivity decreased from 0.58 to 0.23 and ROC-AUC from 0.69 to 0.59. Substantial miscalibration was observed before recalibration, with calibration slopes ranging from 0.020 to 0.828 and intercepts from − 4.130 to − 3.016. Platt scaling markedly improved calibration, producing slopes of 0.810–1.147 and intercepts of − 0.769 to 0.549. Calibrated log loss ranged from 0.074 to 0.080, with NB achieving the lowest value (0.074). The findings demonstrate that model evaluation under severe HIV class imbalance should extend beyond accuracy and ROC-AUC to include minority-class performance and probability calibration. SMOTE did not consistently improve generalization and may reduce performance for some tree-based models when evaluated on naturally distributed data. In contrast, Platt scaling substantially improved the reliability of predicted probabilities. These findings support the use of comprehensive discrimination and calibration assessment when developing HIV risk-classification models, while external and temporal validation remain necessary before practical application. Not applicable.
Language: English
Subfield: Artificial Intelligence
Field: Computer Science
Domain: Physical Sciences
Open Access status: gold
Estimated APC paid: $1,490
OpenAlex ID: W7238807476
FWCI:
Cites:
Cited by:
Related to:
