- 1African Center of Excellence in Bioinformatics and Data Intensive Science, Makerere University, Kampala, Uganda
- 2AIDS Healthcare Foundation (AHF-Uganda Cares), Kampala, Uganda
- 3Medical Research Council/Uganda Virus Research Institute and London School of Hygiene and Tropical Medicine (MRC/UVRI and LSHTM) Uganda Research Unit, Entebbe, Uganda
- 4Precision Healthcare University Research Institute, Queen Mary University of London, London, United Kingdom
- 5Department of Medical Biochemistry, College of Health Sciences, Makerere University, Kampala, Uganda
- 6Department of Non-communicable Disease Epidemiology, London School of Hygiene and Tropical Medicine, London, United Kingdom
Background: People living with HIV (PLWH) are more likely to experience suicidal thoughts and exhibit suicidal behavior than the general population. However, there are currently no effective methods of predicting who is likely to experience suicidal thoughts and behavior. Machine learning (ML) approaches can be leveraged to develop models that evaluate the complex etiology of suicidal behavior, facilitating the timely identification of at-risk individuals and promoting individualized treatment allocation.
Materials and methods: This retrospective case-control study used longitudinal sociodemographic, psychosocial, and clinical data of 1,126 PLWH from Uganda to evaluate the potential of ML in predicting suicidality. In addition, suicidality polygenic risk scores (PRS) were calculated for a subset of 282 study participants and incorporated as an additional feature in the model to determine if including genomic information improves overall model performance. The model’s performance was evaluated using the area under the receiver operating characteristic curve (AUC), positive predictive value (PPV), sensitivity, specificity, and Mathew’s correlation coefficient (MCC).
Results: We trained and evaluated eight different ML algorithms, including logistic regression, support vector machines, Naïve Bayes, k-nearest neighbors, decision trees, random forests, AdaBoost, and gradient-boosting classifiers. Cost-sensitive AdaBoost emerged as the best model, achieving an AUC of 0.79 (95% CI: 0.72–0.87), a sensitivity of 0.63, a specificity of 0.74, a PPV of 0.36, and an NPV of 0.89 on unseen baseline data. The model demonstrated good generalizability, predicting prevalent and incident suicidality at 12-month follow-up with an AUC of 0.75 (95% CI: 0.69–0.81) and 0.69 (95% CI: 0.62–0.76), respectively. Incorporating PRS as an additional feature in the model resulted in a 6% improvement in model sensitivity and a 9% reduction in specificity. A positive MDD diagnosis and high stress contributed the most to predicting suicidality risk.
Conclusion: A cost-sensitive AdaBoost model developed using the sociodemographic, psychosocial, and clinical data of PLWH in Uganda can predict suicidality risk, albeit with modest PPV. Incorporating suicidality PRS improved the overall predictive performance of the model. However, larger studies involving more diverse participants are needed to evaluate the potential of PRS in enhancing risk stratification and the clinical utility of the prediction model.
1 Introduction
Despite commendable progress in expanding access to effective prevention and treatment interventions over the last twenty years, the human immunodeficiency virus/acquired immunodeficiency syndrome (HIV/AIDS) remains a significant public health concern, particularly in sub-Saharan Africa, with approximately 25.6 million people living with HIV (PLWH) (1). Mental illness is a common comorbidity in PLWH due to the shared and intersecting vulnerabilities with HIV/AIDS (2). The presence of mental illness is associated with impaired judgment (3), which impedes timely and regular access to HIV prevention interventions (2). In addition, mental illness and stressful life events are associated with poor adherence to antiretroviral treatment and accelerated HIV disease progression characterized by CD4 cell count decline, increased viral load, and an elevated risk for clinical decline and mortality (4). Globally, there is a higher burden of mental health problems among PLWH compared to the general population (2, 4, 5). This pattern is attributed to the psychological distress associated with being diagnosed with a serious illness, a high burden of opportunistic infections, medication side effects, as well as the social stigma and discrimination associated with HIV (4, 6).
Suicidality, a condition that refers to a wide spectrum of potentially harmful thoughts, behaviors, and experiences that often precede a fatal suicide attempt, is one of the major mental health problems associated with HIV (7). Suicidality occurs along a continuum of severity characterized by transient suicidal thoughts that progress to persistent ruminations about ending one’s life, development of concrete suicide plans, engaging in acts of intentional self-harm, and attempted suicide (8, 9). These may occur independently or together with other psychiatric comorbidities such as major depressive disorder (MDD) (10).
Suicidal ideation is a predictor of future suicidal attempts and completed suicide (11, 12), and PLWH are one hundred times more likely to commit suicide compared to the general population (13). A recent systematic review and meta-analysis on suicidal ideation, attempts, and its associated factors among PLWH in Africa reported a pooled prevalence of 21.7% (16.8-26.63%) for suicidal ideation and 11.06% (6.21-15.92%) for suicidal attempts (3). The substantially high lifetime prevalence of suicidal ideation and attempts among PLWH (13) underlines the crucial need for tools that support the timely and accurate identification of people at risk of suicide. Suicide risk assessment is essential to suicide prevention and achieving health equity for PLWH (14) and should be a priority in PLWH, especially for those with more advanced disease (13).
Suicidality is a complex, multifactorial, and polygenic mental health problem that results from a variable combination of genetic, environmental, and behavioral risk and protective factors (15–18), each having small but meaningful contributions (19). These include situational factors such as a psychiatric diagnosis, hopelessness, perceived burdensomeness, impulsivity, stressful life events, social support, self-esteem, stable employment, problem-solving, and sense of belonging, as well as static or non-modifiable factors such as gender, ethnicity, and psychiatric history (15). The sociodemographic, psychological, and clinical correlates of suicidality among PLWH in Uganda have been extensively studied and include low socioeconomic status (18, 20, 21), unemployment (20), lack of social support (22), stigma (20, 21), poor problem-solving skills (22), state anger, trait anger, hopelessness, low self-esteem (23), low resilience (20), an increasing number of negative life events (11), past psychiatric history (11), anxiety symptoms (23), and MDD (11, 21, 23). Evidence from a genetic variation study among PLWH in Uganda implicated the SA allele at the 5-HTTLPR/rs25531 locus in the serotonin transporter gene to be associated with increased suicidal risk (24). However, results from genome-wide association studies (GWAS) indicate that the genetic architecture of suicidal behavior is complex and highly polygenic (25–27), and recent GWAS findings have confirmed significant shared genetic heritability of suicidal behavior across ancestries (27–30).
The vast number and complexity of the risk factors associated with suicidal thoughts and behaviors limit the magnitude of statistical association with any single risk factor (31) rendering the prediction of suicidal behavior a complex classification problem that requires algorithms that can simultaneously consider tens or hundreds of risk factors to model complex relationships (32). Traditional statistical modeling approaches analyze a limited number of predictor variables at a time and cannot consider and account for complex and contingent interactions among risk factors (31). However, evidence from previous studies indicates that even well-known risk factors of suicidality have modest predictive strength individually (33). Therefore, suicidality predictive models developed using this approach perform only slightly better than random guessing (34).
Machine learning offers new tools to overcome challenges for which traditional statistical methods are not well-suited (35) because ML algorithms can process high-dimensional datasets, recognize complex patterns across multiple interacting risk factors (31), and determine the optimal model (36). As a result, ML has emerged as a promising tool for predicting future suicidal behavior (19, 31, 36, 37) to support the timely identification of at-risk patients whose suicidality might otherwise have gone undetected (37).
Several ML approaches have been applied in the prediction of suicidal behavior—for instance, Nordin et, al (37). identified eight different ML techniques commonly applied in the study of suicidal behavior, i.e. Bayesian-based approaches such as Naïve Bayes (NB), instance-based approaches, artificial neural network (ANN), regularization, decision tree (DT), support vector machine (SVM), regression, and ensemble learning techniques such as random forest (RF). In another systematic review of ML and the prediction of suicide in psychiatric populations, Pigoni et, al (36). reported that random forests (RF), support vector machines (SVM), and convolutional neural networks often outperformed other algorithms. However, none of the studies included in the analyses were conducted in Uganda or among PLWH. Moreover, most previous studies did not incorporate genetic predictors and lacked validation samples to evaluate prediction models.
We evaluated the potential of ML in predicting suicidality using a longitudinal data set of PLWH from Uganda, computed suicidality PRS for a subset of these participants, and examined whether incorporating genomic data could improve the predictive performance of suicidality prediction models trained using sociodemographic, clinical, and psychosocial data only.
2 Materials and methods
2.1 Study design
This retrospective case-control study used sociodemographic, clinical, and genetic data collected between May 2012 and December 2013 by the European & Developing Countries Clinical Trials Partnership (EDCTP) funded Senior Fellowship Study. The EDCTP study was a prospective cohort study that investigated risk factors for psychiatric disorders among adults with HIV/AIDS in Uganda (20).
2.2 Study participants
The primary study recruited anti-retroviral therapy-naïve PLWH who were already enrolled in chronic HIV care at two specialized HIV clinics in Entebbe (semi-urban) and Masaka (rural) areas of Uganda (20). Participants were recruited in the study if they were at least 18 years of age and fluent in English or Luganda (the language in which the study instruments were translated) and were assessed by trained psychiatric nurses for suicidality, MDD, and other psychiatric disorders at baseline and 12 months using the Mini International Neuropsychiatric Interview (MINI) (38) based on the 4th edition of the Diagnostic and Statistical Manual of Mental Disorders (DSM-IV). Study participants who were too ill or unable to understand the study instruments and those who had missed their most recent scheduled clinic visit were excluded. All participants consented to future genetics research and provided blood specimens for DNA extraction. However, genetic data were obtained on only a subset of 282 participants.
2.3 Data description
The data set consists of baseline sociodemographic, psychosocial, and clinical assessment data on 1,126 participants, as well as clinical and psychosocial assessment data on 1,070 study participants at follow-up. In addition, we had individual-level genome-wide data on a subset of 282 participants generated using the H3Africa SNP array version 2, which accounts for the larger genetic diversity and smaller haplotype blocks in African genomes (39). The sociodemographic variables include age, sex, highest educational attainment, religious affiliations, marital status, food security, and employment status. In addition, participants provided information on whether they owned or rented their house, the type of construction material used for constructing the house occupied, whether they had access to electricity, and if they owned durable household assets such as a car, bicycle, radio, telephone, refrigerator, flask, and cupboard. The psychosocial variables included data on social support and the number of negative life events obtained using structured and standardized locally translated psychosocial assessment instruments, previously used among PLWH in Uganda (11, 40). The clinical assessment variables include the duration of HIV infection, CD4 count, height, weight, HIV-related symptoms, HIV-associated neurocognitive impairment, and social impairment. The psychiatric assessment variables included data on previous psychiatric diagnoses, family history of psychiatric disorders, MDD, and suicidality based on the diagnostic output of MINI.
2.4 Data preprocessing
Data preprocessing was performed on the entire dataset to ensure compatibility of features across the training and testing data. We cleaned the data and performed various mathematical and statistical transformations to convert the raw data into formats suitable for use in ML. For the religious affiliation, we reduced the number of independent categories by merging all participants with Christian-leaning beliefs into one category labeled as ‘Christians,’ and those with Islamic beliefs as ‘Muslims.’ Similarly, we merged the detailed subcategories of employment status into two categories, i.e., employed for those with any form of employment and ‘unemployed ‘ for participants without any form of employment. We computed each participant’s wealth index as a proxy measure of the socioeconomic status (SES) index by combining responses to questions on housing characteristics and ownership of eight durable household items commonly found in a typical Ugandan household using multiple correspondence analysis (41–44).
The psychosocial impairment index was derived by summing responses to three questions on how HIV-related illness had disrupted normal activity in the past month, with a higher score indicating higher impairment. Using the European Parasuicide Interview Schedule (EPIS) as modified by Kinyanda and colleagues (40) for the Ugandan context (40), we derived the social support index, negative life events score, and stress score index. The social support index was obtained by summing responses to the items of the social support module of the modified EPIS. To generate data for computing the negative life events score, participants were asked to report whether they had experienced any listed adverse life events in the past 6 months, and for each reported negative life event, participants rated how stressful it was on a 3-point Likert scale (45). We obtained the negative life events score by counting positive responses and the stress score index by summing the ratings of how stressful the reported adverse life events were.
To minimize the adverse impact of extreme values on the performance of our ML outcomes, we performed outlier detection to exclude participants whose age was 1.5 times higher or lower than the interquartile range. We categorized the remaining participants into five age groups based on an age interval of 10 years.
To obtain the binary target variable, we coded all study participants who met the suicidality diagnostic criteria on MINI as cases, and the rest were regarded as controls. We further categorized cases as prevalent if first diagnosed at baseline, incident if first diagnosed at follow-up, or persistent if diagnosed at both the baseline and follow-up. This coding yielded 207 prevalent cases with 919 controls, and 54 incident cases with 1,016 controls. The data is characterized by the existence of a minority and majority class and is technically referred to as imbalanced data (46).
2.5 The problem of class imbalance in machine learning
Machine learning algorithms work optimally with data in which the distribution of the number of instances is almost equal across the classes (46, 47). Training models on imbalanced data can lead to biased models that fail to capture important patterns in the data (46) leading to prediction bias and poor performance of the model in the minority class (48). In suicidality prediction models, this poor performance could translate to missed opportunities to avert death by suicide. Therefore, we applied cost-sensitive learning (CSL) to improve classifier performance. Cost-sensitive learning alleviates the imbalanced data problem by assigning a higher cost for misclassifying the minority (positive) class (49). This strategy is not only computationally efficient, but it also preserves the data distribution (46).
2.6 Feature selection
The baseline data set consists of 300 variables, including data on sociodemographic characteristics, HIV-related symptoms, HIV clinical status, and responses to a series of psychosocial and psychiatric assessment scales for 1,126 study participants. Similarly, the follow-up dataset includes 263 variables covering HIV clinical status, and psychosocial and psychiatric assessment interviews for 1,071 study participants. However, some variables are considerably redundant while others are irrelevant to the classification problem.
We selected suicidality predictors previously documented among PLWH in Uganda. To minimize collinearity between the selected predictor variables, we excluded one from each pair of predictors if their Pearson’s correlation coefficient (continuous) or Cramer’s V (categorical) was greater than 0.5. The final set of predictor variables for inclusion in the model was then selected using the least absolute shrinkage and selection operator (LASSO) algorithm. The LASSO is a penalized regression algorithm that selects training features by gradually shrinking the coefficients of the less important features towards a mean of zero.
This process yielded a total of fourteen composite predictor variables, including study site, sex, highest educational attainment, marital status, employment status, psychiatric history, MDD status, social support, stress, socioeconomic status, age, duration of HIV diagnosis, social impairment, and HIV-related dementia.
2.6.1 Model development
We split the resulting baseline data into training and test sets, allocating 80% of the data for training and 20% for testing, stratified by the target class. We opted for an 80:20 split ratio because of the high number of predictor variables relative to the total number of available data points (50). To remedy the issue of missing data, we imputed missing values by replacing missing continuous data with the median value for the column and missing categorical data with the most frequent value for the column. We then transformed the updated data into features that better represent the underlying problem to the ML algorithms by scaling and normalizing continuous variables or one-hot encoding for categorical variables. The ML models were developed in Python version 3.11.9 using supervised ML algorithms available in the Python library Scikit-learn version 1.3.1 (51).
2.6.2 Machine learning approaches
We trained and evaluated eight classification algorithms frequently encountered in suicidal behavior prediction (37) to explore and select ML approaches that best capture the patterns in our dataset. These include stand-alone algorithms such as logistic regression (LR), SVM, NB, k-nearest neighbors (KNN), and DT classifiers, as well as ensemble algorithms such as RF, adaptive boosting (AdaBoost), and gradient boosting (GB) classifiers.
Logistic regression is ideal for modeling linear relationships and is the most widely used algorithm for binary classification, due to its simplicity, and efficiency in handling large datasets. However, it struggles with modeling complex non-linear data. Support vector machines are more suited for the classification of non-linearly separable data. They perform classification in a single decision step by leveraging kernel functions to map non-linearly separable data into higher dimensional space to find a decision boundary (hyperplane) that best separates the different classes.
Naïve Bayes is a fast classification algorithm based on Baye’s theorem of conditional probability. It is robust in handling categorical features but is undermined by the assumption of strong conditional independence among predictor variables. On the other hand, the KNN algorithm assigns equal importance to all features, and it relies on the similarity of the training examples to the test data to predict the cluster to which a new object belongs by majority vote between the k-nearest neighbors.
Decision trees perform classification by recursively partitioning data into nodes and leaves, creating interpretable tree-like structures. Random forests are an extension of decision trees that use majority voting to combine decisions from multiple decision tree models obtained from different subsets of the same dataset to produce a final classification decision. They are highly effective in processing high-dimensional, correlated data and are considered the state-of-the-art algorithm in suicidality prediction. Another extension of the DT model is AdaBoost, which refines predictions by iteratively focusing on misclassified examples, to produce a weighted ensemble model. The GB model is a robust, interpretable classification algorithm based on a gradient descent-based approach. It is particularly suited for handling noisy or incomplete data, making it valuable in psychiatric research.
2.6.3 Model performance
The performance of prediction models was assessed using a suite of classification metrics, including accuracy, F1-score, area under the receiver operating characteristic curve (AUC), sensitivity, specificity, positive predictive value (PPV), negative predictive value (NPV), and Mathew’s correlation coefficient (MCC). Each of these metrics is derived from the confusion matrix and conveys specific information about the quality of a classification (52). Accuracy is an intuitive metric depicting the overall proportion of correct predictions. However, it can be misleading in class-imbalanced datasets because it disregards the model’s performance on the minority class and provides an over-optimistic estimate of the classifier’s ability (53). Sensitivity and specificity are key measures of diagnostic accuracy that reflect the model’s ability to correctly classify positive and negative instances, respectively. Sensitivity and specificity are independent of disease prevalence but can vary depending on the spectrum of the disease in the studied group (54). Positive predictive value and NPV focus on the correctness of positive and negative predictions, offering a more nuanced understanding of prediction quality. The F1-score is the harmonic mean of precision (positive predictive value) and recall (sensitivity) and is a popular metric for imbalanced data sets. However, it can be misleading because it does not consider negative instances correctly classified by the ML classifier and is not invariant to class-swapping. The Pearson-Mathews correlation coefficient (MCC) relies on information from all four quadrants of the confusion matrix, and it is considered one of the most useful performance metrics for a binary classification in class-imbalanced data (55). The ROC curve AUC summarizes the model’s ability to discriminate between positive and negative cases across all decision thresholds. It is regarded as the most robust metric for comparing model performance because it is invariant to class imbalance (56).
2.7 Model optimization
We performed an exhaustive grid search across each model’s hyperparameter space using 10-fold stratified cross-validation with AUC as the scoring metric. The best parameters for tuning the models were selected using the mean cross-validation AUC across the ten folds.
2.8 Model explanation
We used the Shapley additive explanation (SHAP) approach to identify and visualize the important features contributing to the learning and prediction of the models. SHAP is a model-agnostic framework that offers a straightforward and consistent approach to interpreting model predictions by leveraging game theory techniques to assign a value (SHAP value) to each feature for a particular prediction (57). The SHAP values were presented as a bee swarm plot illustrating the direction and relative importance of these input features for the models’ predictions.
2.9 Suicidality polygenic risk scores
We used individual-level genotype data for the subset of 282 study participants to calculate suicidality PRS and determine if incorporating them in the selected baseline models improves their performance.
2.9.1 Target data preparation
The genotype data were converted to PLINK binary format using PLINK 1.9 software (58) and then subjected to rigorous pre- and post-imputation quality control (QC). The pre-imputation QC steps were performed using the human heredity and Health Africa (H3A) GWAS pipeline (59) and included the removal of duplicate single nucleotide polymorphisms (SNPs), individuals with discordant sex information, non-autosomal SNPS, SNPs with minor allele frequency (MAF) < 0.05, poorly genotyped SNPs with genotyping rate < 0.9, poorly genotyped individuals with SNP missingness >0.02, and SNPs that violated the Hardy-Weinberg equilibrium (HWE) p-value threshold of 1e-6. In addition, we performed relatedness and heterozygosity checks to exclude closely related pairs of individuals based on identity by descent (IBD) ≥ 0.11 and samples with high heterozygosity ≥ 0.34 or low heterozygosity ≤ 0.15. Overall, 1,780,439 SNPs and 262 samples passed the pre-imputation QC filters and were used for SNP imputation. The untyped SNPs were imputed against the Africa Genome Resources (AGR) reference panel on the Sanger imputation service (60). In the post-imputation QC, each of the 22 chromosome files was processed separately to exclude SNPs with MAF < 0.01, imputation info score (INFO) < 0.8, and HWE p-value < 1e-6. The quality-controlled data were merged into a single file containing 12,420,057 SNPs for 261 study participants.
2.9.2 Base data
The base data was derived from European ancestry GWAS summary statistics consisting of 8,905,379 SNPs on the full-scale ordinal suicidality scale in the UK Biobank cohort (25). After standard GWAS QC to exclude SNPS with INFO score < 0.8 and MAF < 0.01, we retained 8,904674 SNPs.
To improve the transferability of PRS between the discovery and target populations, we relied on the PRS-CSx method to infer posterior SNP effect size estimates in the target population. Given GWAS summary statistics of the discovery cohort, PRS-CSx models population-specific allele frequencies and LD patterns by relying on Bayesian regression and continuous shrinkage priors on a reference population (61).
2.10 Ethical considerations
This research obtained ethical approval from Makerere University, College of Health Sciences, School of Biomedical Sciences, Institutional Review Board under reference number SBS-2023-473.
3 Results
3.1 Characteristics of the study participants
Of the 1,126 study participants with baseline data, 207 (18.4%) had a positive suicidality diagnosis based on the B items of the MINI. These were coded as cases, while the remaining 921 participants were coded as controls. Only 11 (5.3%) of the participants who met the suicidality diagnostic criteria scored more than 9 on the B items of the MINI, implying that most participants had low severity of suicidality symptoms. Figure 1 shows the distribution of participants by severity of suicidality symptoms.

Figure 1. Bar chart for the distribution of study participants by the severity of their suicidality symptoms at baseline. Suicidality categories are based on the B items of the MINI with cut-off scores of <9 (low), 9 to 15 (moderate), and >16 (high).
Most of the study participants (77.2%) were female, aged between 18 and 82 years with a mean age of 35 (SD 9.3) years, had attained primary-level education (61.8%), and were married (51.5%). A total of 17 participants whose age was 1.5 times higher or lower than the interquartile range were excluded from further analysis. The final models were developed using data from 1,109 participants, including 205 cases and 904 controls. At follow-up, 56 (5.0%) of participants were lost to follow-up, leaving 1,070 participants, of whom 86 (8.0%) had a positive suicidality diagnosis. The demographic characteristics of all the study participants are presented in Table 1.

Table 1. Baseline demographic characteristics of study participants disaggregated by enrolment site.
3.2 Model selection and optimization
We trained and evaluated eight ML models using default parameters. All the models performed better than random guessing, achieving overall AUCs between 0.59 and 0.78 with low sensitivity and high specificity. Table 2 shows the comparative performance of the baseline suicidality prediction models across selected binary classification metrics. The GB, AdaBoost, LR, and RF demonstrated slightly better discriminative ability, achieving an overall AUC of 0.78, 0.77, 0.76, and 0.73, respectively. On the other hand, NB and DT achieved comparably greater sensitivity than the rest of the models.
Figure 2 shows the comparative discriminative performance of the classification models during the training and testing phases.

Figure 2. Comparative performance of the models on the training dataset. The mean cross-validation area under the curve was obtained using stratified 10-fold cross-validation. The black dots represent outliers, and the red dots indicate the mean cross-validation area under the curve. CV_AUC, mean cross-validation area under the curve; KNN, k-nearest neighbors; DT, decision tree classifier; SVM, support vector machines; NB, naïve Bayes; GB, gradient boosting; RF, random forest; LR, logistic regression.
After hyperparameter tuning, the AdaBoost and GB models performed similarly, achieving an overall AUC of 0.79 on the test dataset. However, inspection of the combined ROC curves (Figure 3) revealed multiple points where the two curves intersect, implying that either model could have greater sensitivity than the other for some specificity thresholds.

Figure 3. Receiver operating characteristic curves of the best-performing models for predicting suicidality. The receiver operating characteristic curves for AdaBoost and gradient boosting models intersect at several points, making it difficult to choose the best-performing model based on the overall area under the curve. GB, Gradient boosting classifier.
Since overall AUC is computed by integrating the model’s performance across all possible thresholds, selecting a superior model when two ROC curves intersect is challenging. To overcome this impasse, we computed the models’ partial AUC focusing on the ROC curve’s early retrieval (ER) area, which shows the model’s ability to correctly identify positive cases when the false positive rate (FPR) is low. The partial AUC corresponding to an FPR of 0.1 (ROC-AUC_0.1) revealed that AdaBoost was the best model for predicting suicidality. Figure 4 shows McClish’s corrected partial AUC at an FPR of 0.1 and 0.2, corresponding to misclassification of 10% and 20% of negative cases as positive.

Figure 4. Comparison of McClish-adjusted early retrieval area under the curve of the AdaBoost and gradient boosted models. The AdaBoost model is superior to the gradient boosted model in predicting the positive class when the false positive rate is low. ROC-AUC_0.1: area under the receiver operating characteristics curve when false positive rate is 10%, ROC-AUC_0.2: area under the receiver operating characteristics curve when false positive rate is 20%.
3.3 Model performance after correcting the class imbalance
Using the class imbalance ratio of 4.44 as the penalty for the misclassification of the minority class, we developed a cost-sensitive AdaBoost model that achieved a sensitivity of 0.63, a specificity of 0.74, a PPV of 0.36, and an NPV of 0.89. A summary of the model performance before and after correcting class imbalance is provided in Table 3.

Table 3. Comparative performance of cost-insensitive and cost-sensitive AdaBoost model for predicting suicidality.
The most important features contributing to predictions in the model were MDD diagnosis, stress category, HIV dementia, psychosocial impairment, social support, age, and marital status. A positive MDD diagnosis and high-stress levels strongly contributed to a positive suicidality prediction, while a negative MDD diagnosis, low social impairment, moderate social support, age between 28 and 37, and being married had a strong protective effect against suicidality. The features contributing to predictions in the AdaBoost model are shown in Figure 5.

Figure 5. Features contributing to suicidality predictions in the cost-sensitive AdaBoost model. The red dots indicate high contributions, and the blue dots indicate low contributions to the model’s predicted outcomes. MDD, positive MDD diagnosis; No MDD, negative MDD diagnosis; SES, socioeconomic status; HIV Dx, duration of HIV. diagnosis.
3.4 Predicting future suicidality risk
To evaluate the generalizability of our prediction model, we validated its performance using psychosocial and clinical data collected at the 12-month follow-up. The cost-sensitive AdaBoost model achieved an overall AUC of 0.75 (95% CI: 0.69 - 0.81), a sensitivity of 0.41, a specificity of 0.93, a PPV of 0.33, an NPV of 0.95, and an MCC of 0.31 in predicting 12-month suicidality risk. In addition, the model predicted incident suicidality with an AUC of 0.69 (95% CI: 0.62 - 0.76), a sensitivity of 0.33, a specificity of 0.91, a PPV of 0.17, and an NPV of 0.96.
Model calibration using Platt scaling revealed satisfactory performance in the lower probability range (0.0–0.4), where the predicted probabilities closely correspond to the observed outcomes. However, the model appears overconfident in the intermediate probability range (0.4–0.7) and becomes erratic in the higher probability region (>0.7). The calibration plot showing the predicted and observed suicidality risk is provided in Figure 6.

Figure 6. Calibration plot for the cost-sensitive AdaBoost classifier showing the relationship between predicted probabilities and observed outcomes. The model is well calibrated in the lower probability range but becomes overconfident in the mid probability range and erratic in the higher probability range.
3.5 Suicidality polygenic risk scores
Polygenic risk scores for 261 participants were computed from 943,448 SNPs. We fitted a mixed-effects logistic regression model in R (62), and calculated the Nagelkerke pseudo-R2, with and without the PRS scores as the full and null model, respectively. After adjusting for the covariates of sex, age, MDD status, and the first ten principal components, suicidality PRS accounted for 0.74% of the phenotypic variance between cases and controls.
3.6 Impact of incorporating suicidality polygenic risk scores in the prediction model
We trained and evaluated the performance of a cost-sensitive AdaBoost model using the baseline data of the 282 participants for whom individual-level genetic data were available. The model achieved an overall AUC of 0.72 (95% CI: 0.57 – 0.86), with a slightly higher sensitivity (0.67) compared to the model trained using sociodemographic, psychosocial, and clinical predictors only. Figure 7 shows the most prominent features contributing to suicidality predictions in the model trained using a combination of sociodemographic, clinical, psychosocial, and genetic risk factors.

Figure 7. Feature importance of the variables contributing to suicidality prediction after incorporating PRS in the cost-sensitive AdaBoost model. The red dots indicate strong contributions to the model’s predicted outcomes, and the blue dots show low contributions to the predicted outcomes. PRS, polygenic risk score; SES, socioeconomic status; HIV Dx, duration of HIV diagnosis; Hx of psychiatric DX, history of psychiatric diagnosis.
4 Discussion
This study explored the potential of various ML algorithms in predicting suicidality using longitudinal sociodemographic, clinical, and psychosocial data of PLWH in Uganda. In addition, we computed suicidality PRS and assessed their contribution to the predictive performance of the models. To the best of our knowledge, this is the first study to apply machine learning to predicting suicidality in PLWH in Uganda. In addition, it is the first study to integrate genetic and environmental risk factors into an ML framework for suicidality prediction in PLWH within Africa.
The prevalence of suicidality observed in the study population (18.4%) is slightly higher than the 10.6% reported in the general population in Uganda (63). Whereas the suicidality estimates among PLWH in HIV endemic countries generally approximate those in the general population, the difference can be attributed to temporal changes in suicidal behavior over the past ten years.
Overall, models developed using ensemble learning algorithms outperformed the stand-alone models across all the selected binary classification metrics, with an overall AUC ranging between 0.72 and 0.79 across the top five prediction models. The AUC is a summary metric of the ROC curve with values ranging between 0 and 1, and according to the proposed ranges for interpreting the relationship between AUC and the diagnostic accuracy of the model (54), our models are considered ‘very good’ at distinguishing between diseased and non-diseased individuals. Nonetheless, even our best-performing model would be of limited clinical utility (64).
We employed cost-sensitive learning to correct class imbalance and improve model performance while preserving the underlying distribution of the data. Cost-sensitive learning resulted in a 320% increment in model sensitivity and a 24% and 46% decline in specificity and PPV, respectively. According to Wang et al. (65), sensitivity and PPV are functions of the model cut-off threshold, such that an increase in sensitivity is accompanied by a rapid increment in the FPR that in turn results in a reduced PPV (65).
Regarding the importance of features measured using SHAP values, MDD status, stress levels, HIV dementia, psychosocial impairment, social support, age, and marital status were among the top ten features contributing to suicidality predictions. However, a formal MDD diagnosis and high stress were the most significant positive predictors of suicidality risk.
A positive MDD diagnosis is a major risk factor for suicidality among both PLWH (11, 20, 66, 67) and the general population (15, 68). In the same vein, stressful life events are recognized as triggers of suicidal behavior, and it is believed that exposure to chronic stress can progressively erode an individual’s resilience in dealing with stressful situations and lead to a higher probability of engaging in suicidal behavior (69). These findings are consistent with the stress vulnerability model of suicidality, which asserts that suicidal behavior involves vulnerability or diathesis as a distal risk factor that predisposes individuals to suicidal behavior when stress is encountered (70).
To our knowledge, there have been no previous studies that used ML for suicidality prediction among PLWH; however, our results are consistent with the findings from studies in the general population. Su et, al (71) developed a model for predicting self-harm and suicide attempts using data on 2,809 Australian adolescents and obtained an AUC of 0.74 and 0.72 for self-harm and suicide attempts, respectively. In addition, they reported that depression was the most important factor for predicting self-harm and suicide attempts (71). Similarly, Bazrafshan et, al (72). reported an AUC of 0.8 for an RF model developed using longitudinal data on a sample containing 3,833 cases obtained from hospitals across the Ilam Province in Iran. They also reported that age group, educational level, marital status, and employment, among others, were significantly associated with suicide (72). On the other hand, Macalli et, al (73). reported an AUC of 0.80 in predicting suicidal thoughts and behaviors among 5,066 college students in France.
The variance explained by suicidality PRS was low, accounting for 0.74% of the phenotypic differences between suicidality cases and controls. However, this is not surprising because the predictive power of PRS decays with increasing genetic distance of the target cohort from the discovery cohort.
Incorporating PRS as an additional feature in the model resulted in a 6% improvement in sensitivity and a 9% reduction in specificity. However, it is worth noting that our PRS findings were purely exploratory, and there is an urgent need for larger, ancestry-matched GWAS data sets to support future PRS refinement in African populations.
5 Strengths and limitations
The key strength of our study is that we utilized longitudinal data, consisting of both dynamic and static risk factors for suicidality. We relied on a cost-sensitive learning approach to mitigate the class imbalance in the data by assigning a higher misclassification cost for the positive class. In addition, we incorporated suicidality PRS data in our model to account for the contribution of genetic variation in suicidality risk. We also calibrated and evaluated the generalizability of our models in predicting future suicidality risk.
A key limitation of our study is the broad definition of the suicidality phenotype used in developing the model. The majority of the study participants presented with low severity of suicidality symptoms, representing a low risk of suicide attempt and death. However, progression from suicidal ideation to suicidal attempt and death can occur rapidly, and the utility of the model lies in increasing the index of suspicion of clinicians to conduct targeted clinical evaluation for patients that the model has flagged. This could significantly improve early detection and support timely suicide prevention in resource-limited settings.
6 Conclusion and recommendations
Machine learning models can effectively predict suicidality using the sociodemographic, psychosocial, and clinical data of PLWH in Uganda. This is significant because these data are easy to collect and are readily available in electronic format in most HIV care and treatment centers in Uganda. The ROC-AUC_0.1 depicts the model’s ability to predict the positive class, enabling a straightforward comparison and selection of a suitable model in scenarios where minimizing false positives is critical. Incorporating suicidality PRS modestly improves the overall predictive performance of the model developed using sociodemographic, psychosocial, and clinical predictors.
Larger studies that include more diverse participants of African ancestry are required to validate whether the inclusion of suicidality PRSs in clinical prediction models can enhance the stratification of patients at risk of suicide attempts. In addition, future studies could be designed to assess the utility and cost-effectiveness of deploying suicidality prediction models in a clinical setting.
Data availability statement
The datasets for this article are not publicly available because they contain personally identifying information, but can be availed upon a reasonable request and in accordance with the data sharing policy (https://www.lshtm.ac.uk/sites/default/files/research_data_management_policy.pdf https://www.lshtm.ac.uk/sites/default/files/research_data_management_policy.pdf). Requests to access these datasets should be directed to RXVnZW5lLktpbnlhbmRhQG1yY3VnYW5kYS5vcmc=. All the code used in this analysis is available at: https://github.com/abmutema/Predicting-suicidality-in-people-living-with-HIV-in-Uganda.
Ethics statement
The studies involving humans were approved by MAK School of Biomedical Sciences REC (SBSREC)College of Health Sciences, Makerere University. The studies were conducted in accordance with the local legislation and institutional requirements. The participants provided their written informed consent to participate in this study.
Author contributions
AM: Conceptualization, Data curation, Formal Analysis, Methodology, Visualization, Writing – original draft. LL: Writing – review & editing. DJ: Supervision, Writing – review & editing. SF: Writing – review & editing. EK: Conceptualization, Funding acquisition, Methodology, Supervision, Writing – review & editing. AK: Conceptualization, Methodology, Supervision, Writing – review & editing.
Funding
The author(s) declare financial support was received for the research and/or publication of this article. The data used in this work was collected with support from the European & Developing Countries Clinical Trials Partnership (EDCTP) senior Fellowship to EK (Project No. TA.2010.40200.011). AK is a Wellcome Early Career Fellow (grant number: 227053/Z/23/Z).
Acknowledgments
We thank all the study participants who agreed to participate and the research assistants who collected the data.
Conflict of interest
The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.
Generative AI statement
The author(s) declare that no Generative AI was used in the creation of this manuscript.
Any alternative text (alt text) provided alongside figures in this article has been generated by Frontiers with the support of artificial intelligence and reasonable efforts have been made to ensure accuracy, including review by the authors wherever possible. If you identify any issues, please contact us.
Publisher’s note
All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.
References
1. HIV/AIDS | WHO | Regional office for Africa. Available online at: https://www.afro.who.int/health-topics/hivaids (Accessed October 21, 2024).
2. Remien RH, Stirratt MJ, Nguyen N, Robbins RN, Pala AN, and Mellins CA. Mental health and HIV/AIDS: The need for an integrated response. AIDS. (2019) 33:1411–20. Available online at: https://www.researchgate.net/publication/332269682_Mental_health_and_HIVAIDS_The_need_for_an_integrated_response (Accessed November 28, 2024).
3. Necho M, Tsehay M, and Zenebe Y. Suicidal ideation, attempt, and its associated factors among HIV/AIDS patients in Africa: a systematic review and meta-analysis study. Int J Ment Health Syst. (2021) 15:1–16. doi: 10.1186/s13033-021-00437-3
4. Hoare J, Sevenoaks T, Mtukushe B, Williams T, Heany S, and Phillips N. Global systematic review of common mental health disorders in adults living with HIV. Curr HIV/AIDS Rep. (2021) 18:569–80. doi: 10.1007/s11904-021-00583-w
5. Lampe FC. Increased risk of mental illness in people with HIV. Lancet HIV. (2022) 9:e142–4. Available online at: http://www.thelancet.com/article/S2352301822000340/fulltext (Accessed November 29, 2024).
6. Adraro W, Abeshu G, and Abamecha F. Physical and psychological impact of HIV/AIDS toward youths in Southwest Ethiopia: a phenomenological study. BMC Public Health. (2024) 24:1–9. doi: 10.1186/s12889-024-20478-w
7. Obegi JH. Is suicidality a mental disorder? Applying DSM-5 guidelines for new diagnoses. Death Stud. (2021) 45:638–50. doi: 10.1080/07481187.2019.1671546
8. Harmer B, Lee S, Rizvi A, and Saadabadi A. Suicidal ideation. In: Acute Medicine: A Symptom-Based Approach. StatPearls Publishing (2024). p. 415–20. Available online at: https://www.ncbi.nlm.nih.gov/books/NBK565877/.
9. Sarkhel S, Vijayakumar V, and Vijayakumar L. Clinical practice guidelines for management of suicidal behaviour. Indian J Psychiatry. (2023) 65:124–30. doi: 10.4103/indianjpsychiatry.indianjpsychiatry_497_22
10. Obegi JH. Rethinking suicidal behavior disorder. Crisis. (2018) 40:209–19. doi: 10.1027/0227-5910/a000543
11. Kinyanda E, Hoskins S, Nakku J, Nawaz S, and Patel V. The prevalence and characteristics of suicidality in HIV/AIDS as seen in an African population in Entebbe district, Uganda. BMC Psychiatry. (2012) 12. doi: 10.1186/1471-244X-12-63
12. Rukundo GZ, Levin J, Mpango RS, Patel V, and Kinyanda E. Effect of suicidality on clinical and behavioural outcomes in HIV positive adults in Uganda. PloS One. (2021) 16. doi: 10.1371/journal.pone.0254830
13. Pelton M, Ciarletta M, Wisnousky H, Lazzara N, Manglani M, Ba DM, et al. Rates and risk factors for suicidal ideation, suicide attempts and suicide deaths in persons with HIV: A systematic review and meta-analysis. Gen Psychiatr. (2021) 34. doi: 10.1136/gpsych-2020-100247
14. Liu Y, Songtaweesin WN, Tucker JD, Sohn AH, Latkin CA, and Hall BJ. Suicide prevention research is crucial to achieving health equity for people with HIV. Lancet HIV. (2022) 9:e745–6. Available online at: http://www.thelancet.com/article/S235230182200296X/fulltext (Accessed November 29, 2024).
15. Holman MS and Williams MN. Suicide risk and protective factors: A network approach. Arch Suicide Res. (2022) 26:1–18. doi: 10.1080/13811118.2020.1774454
16. Abou Chahla MN, Khalil MI, Comai S, Brundin L, Erhardt S, and Guillemin GJ. Biological factors underpinning suicidal behaviour: an update. Brain Sci. (2023) 13:505. Available online at: https://www.mdpi.com/2076-3425/13/3/505/htm (Accessed December 10, 2024).
17. Levey DF, Polimanti R, Cheng Z, Zhou H, Nuñez YZ, Jain S, et al. Genetic associations with suicide attempt severity and genetic overlap with major depression. Transl Psychiatry. (2019) 9. doi: 10.1038/s41398-018-0340-2
18. Campbell-Sills L, Sun X, Papini S, Choi KW, He F, Kessler RC, et al. Genetic, environmental, and behavioral correlates of lifetime suicide attempt: Analysis of additive and interactive effects in two cohorts of US Army soldiers. Neuropsychopharmacology. (2023) 48:1623–9. Available online at: https://www.nature.com/articles/s41386-023-01596-2 (Accessed January 18, 2024).
19. Boudreaux ED, Rundensteiner E, Liu F, Wang B, Larkin C, Agu E, et al. Applying machine learning approaches to suicide prediction using healthcare data: overview and future directions. Front Psychiatry. (2021) 12:707916. Available online at: https://cdn.preterhuman.net/texts/science_and_technology/ (Accessed June 25, 2024).
20. Kinyanda E, Nakasujja N, Levin J, Birabwa H, Mpango R, Grosskurth H, et al. Major depressive disorder and suicidality in early HIV infection and its association with risk factors and negative outcomes as seen in semi-urban and rural Uganda. J Affect Disord. (2017) 212:117–27. doi: 10.1016/j.jad.2017.01.033
21. Rukundo GZ, Mpango RS, Ssembajjwe W, Gadow KD, Patel V, and Kinyanda E. Prevalence and risk factors for youth suicidality among perinatally infected youths living with HIV/AIDS in Uganda: the CHAKA study. Child Adolesc Psychiatry Ment Health. (2020) 14:1–9. doi: 10.1186/s13034-020-00348-0
22. Rukundo GZ, Kinyanda E, and Mishara B. Clinical correlates of suicidality among individuals with HIV infection and AIDS disease in Mbarara, Uganda. Afr J AIDS Res. (2016) 15:227–32. doi: 10.2989/16085906.2016.1182035
23. Rukundo GZ, Mishara B, and Kinyanda E. Psychological correlates of suicidality in HIV/AIDS in semi-urban south-western Uganda. Trop Doct. (2016) 46:211–5. doi: 10.1177/0049475515623110
24. Kalungi A, Seedat S, Hemmings SMJ, van der Merwe L, Joloba ML, Nanteza A, et al. Association between serotonin transporter gene polymorphisms and increased suicidal risk among HIV positive patients in Uganda. BMC Genet. (2017) 18. doi: 10.1186/s12863-017-0538-y
25. Strawbridge RJ, Ward J, Ferguson A, Graham N, Shaw RJ, Cullen B, et al. Identification of novel genome-wide associations for suicidality in UK Biobank, genetic correlation with psychiatric disorders and polygenic association with completed suicide. EBioMedicine. (2019) 41:517–25. doi: 10.1016/j.ebiom.2019.02.005
26. Docherty AR, Mullins N, Ashley-Koch AE, Qin XJ, Coleman J, Shabalin AA, et al. Genome-wide association study meta-analysis of suicide attempt in 43,871 cases identifies twelve genome-wide significant loci. Am J Psychiatry. (2022) 180(10):723–38. doi: 10.1101/2022.07.03.22277199
27. Ashley-Koch AE, Kimbrel NA, Qin XJ, Lindquist JH, Garrett ME, Dennis MF, et al. Genome-wide association study identifies four pan-ancestry loci for suicidal ideation in the Million Veterans Program. PloS Genet. (2023) 19:e1010623. doi: 10.1176/appi.ajp.21121266
28. Ruderfer DM, Walsh CG, Aguirre MW, Tanigawa Y, Ribeiro JD, Franklin JC, et al. Significant shared heritability underlies suicide attempt and clinically predicted probability of attempting suicide. Mol Psychiatry. (2020) 25:2422–30. doi: 10.1038/s41380-018-0326-8
29. Kimbrel NA, Ashley-Koch AE, Qin XJ, Lindquist JH, Garrett ME, Dennis MF, et al. A genome-wide association study of suicide attempts in the million veterans program identifies evidence of pan-ancestry and ancestry-specific risk loci. Mol Psychiatry. (2022) 27:2264–72. doi: 10.1038/s41380-022-01472-3
30. Mullins N, Kang JE, Campos AI, Coleman JRI, Edwards AC, Galfalvy H, et al. Dissecting the shared genetic architecture of suicide attempt, psychiatric disorders, and known risk factors. Biol Psychiatry. (2022) 91:313–27. doi: 10.1016/j.biopsych.2021.05.029
31. McHugh CM and Large MM. Can machine-learning methods really help predict suicide? In: Current opinion in psychiatry, vol. 33. Phildalaphia, USA: Wolters Kluwer Health, Inc. (2020). p. 369–74.
32. Ribeiro JD, Franklin JC, Fox KR, Bentley KH, Kleiman EM, Chang BP, et al. Letter to the Editor: Suicide as a complex classification problem: Machine learning and related techniques can advance suicide prediction - A reply to Roaldset (2016). Psychol Med. (2016) 46:2009–10. doi: 10.1017/S0033291716000611
33. Franklin JC, Ribeiro JD, Fox KR, Bentley KH, Kleiman EM, Huang X, et al. Risk factors for suicidal thoughts and behaviors: A meta-analysis of 50 years of research. Psychol Bull. (2017) 143:187–232. doi: 10.1037/bul0000084
34. Ribeiro JD, Huang X, Fox KR, Walsh CG, and Linthicum KP. Predicting imminent suicidal thoughts and nonfatal attempts: the role of complexity. Clin Psychol Sci. (2019) 7:941–57. doi: 10.1177/2167702619838464
35. Jiang T, Gradus JL, and Rosellini AJ. Supervised machine learning: A brief primer. Behav Ther. (2020) 51:675–87. doi: 10.1016/j.beth.2020.05.002
36. Pigoni A, Delvecchio G, Turtulici N, Madonna D, Pietrini P, Cecchetti L, et al. Machine learning and the prediction of suicide in psychiatric populations: a systematic review. Trans Psychiatry. (2024) 14:1–22. Available online at: https://www.nature.com/articles/s41398-024-02852-9 (Accessed November 28, 2024).
37. Nordin N, Zainol Z, Mohd Noor MH, and Chan LF. Suicidal behaviour prediction models using machine learning techniques: A systematic review. Artif Intell Med. (2022) 132:102395. doi: 10.1016/j.artmed.2022.102395
38. Sheehan DV, Lecrubier Y, Sheehan KH, Amorim P, Janavs J, Weiller E, et al. The mini-international neuropsychiatric interview (M.I.N.I.): the development and validation of a structured diagnostic psychiatric interview for DSM-IV and ICD-10. J Clin Psychiatry. (1998) 59:11980. Available online at: https://www.psychiatrist.com/jcp/neurologic/neurology/mini-international-neuropsychiatric-interview-mini (Accessed April 27, 2023).
39. Mulder N, Abimiku A, Adebamowo SN, de Vries J, Matimba A, Olowoyo P, et al. H3Africa: current perspectives. Pharmgenomics Pers Med. (2018) 11:59–66. doi: 10.2147/PGPM.S141546
40. Kinyanda E, Hjelmeland H, and Musisi S. Negative life events associated with deliberate self-harm in an African population in Uganda. Crisis. (2005) 26:4–11. doi: 10.1027/0227-5910.26.1.4
41. Strzelecka A, KurdyS-Kujawska A, and Zawadzka D. Application of multidimensional correspondence analysis to identify socioeconomic factors conditioning voluntary life insurance. Procedia Computer Science. (2020) 176:3407–17. Available online at: https://www.sciencedirect.com/science/article/pii/S1877050920319517.
42. Omondi I, Odiere MR, Rawago F, Mwinzi PN, Campbell C, and Musuva R. Socioeconomic determinants of Schistosoma mansoni infection using multiple correspondence analysis among rural western Kenyan communities: Evidence from a household-based study. PloS One. (2021) 16:e0253041. doi: 10.1371/journal.pone.0253041
43. Ambapour S and Ambapour S. Using multiple correspondence analysis to measure multidimensional poverty in Congo. J Data Anal Inf Process. (2020) 8:241–66. Available online at: http://www.scirp.org/journal/PaperInformation.aspx?PaperID=103350 (Accessed July 30, 2024).
44. Abdi H and Valentin D. Multiple correspondence analysis. Available online at: http://www.utd.edu/ (Accessed July 30, 2024).
45. Kinyanda E, Hoskins S, Nakku J, Nawaz S, and Patel V. Prevalence and risk factors of major depressive disorder in HIV/AIDS as seen in semi-urban Entebbe district, Uganda. BMC Psychiatry. (2011) 11. doi: 10.1186/1471-244X-11-205
46. Araf I, Idri A, and Chairi I. Cost-sensitive learning for imbalanced medical data: a review. Artif Intell Rev. (2024) 57:1–72. doi: 10.1007/s10462-023-10652-8
47. Khan AA, Chaudhari O, and Chandra R. A review of ensemble learning and data augmentation models for class imbalanced problems: Combination, implementation and evaluation. Expert Syst Appl. (2024) 244:122778. doi: 10.1016/j.eswa.2023.122778
48. Alkhawaldeh IM, Albalkhi I, and Naswhan AJ. Challenges and limitations of synthetic minority oversampling techniques in machine learning. World J Methodol. (2023) 13:373–8. doi: 10.5662/wjm.v13.i5.373
49. Fernández A, García S, Galar M, Prati RC, Krawczyk B, and Herrera F. Cost-sensitive learning. Learn Imbalanced Data Sets. (2018), 63–78. doi: 10.1007/978-3-319-98074-4_4
50. Sivakumar M, Parthasarathy S, and Padmapriya T. Trade-off between training and testing ratio in machine learning for medical image processing. PeerJ Comput Sci. (2024) 10:e2245. Available online at: https://pmc.ncbi.nlm.nih.gov/articles/PMC11419616/.
51. Pedregosa F, Michel V, Grisel Oliviergrisel O, Blondel M, Prettenhofer P, Weiss R, et al. Scikit-learn: machine learning in python. J Mach Learn Res. (2011) 12:2825–30. Available online at: http://jmlr.org/papers/v12/pedregosa11a.html (Accessed June 26, 2024).
52. Foody GM. Challenges in the real world use of classification accuracy metrics: From recall and precision to the Matthews correlation coefficient. PLoS One. (2023) 18:e0291908. Available online at: https://pmc.ncbi.nlm.nih.gov/articles/PMC10550141/.
53. Thölke P, Mantilla-Ramos YJ, Abdelhedi H, Maschke C, Dehgan A, Harel Y, et al. Class imbalance should not throw you off balance: Choosing the right classifiers and performance metrics for brain decoding with imbalanced data. Neuroimage. (2023) 277:120253. doi: 10.1016/j.neuroimage.2023.120253
54. Šimundić AM. Measures of diagnostic accuracy: basic definitions. EJIFCC. (2009) 19:203–11. Available online at: https://pmc.ncbi.nlm.nih.gov/articles/PMC4975285/.
55. Stoica P and Babu P. Pearson–Matthews correlation coefficients for binary and multinary classification. Signal Processing. (2024) 222:109511. doi: 10.1016/j.sigpro.2024.109511
56. Richardson E, Trevizani R, Greenbaum JA, Carter H, Nielsen M, and Peters B. The receiver operating characteristic curve accurately assesses imbalanced datasets. Patterns. (2024) 5:100994. doi: 10.1016/j.patter.2024.100994
57. Lundberg SM, Allen PG, and Lee SI. (2017). A unified approach to interpreting model predictions, in: 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Available online at: https://github.com/slundberg/shap (Accessed October 23,2024).
58. Chang CC, Chow CC, Tellier LCAM, Vattikuti S, Purcell SM, and Lee JJ. Second-generation PLINK: Rising to the challenge of larger and richer datasets. Gigascience. (2015) 4. doi: 10.1186/s13742-015-0047-8
59. Brandenburg JT, Clark L, Botha G, Panji S, Baichoo S, Fields C, et al. H3AGWAS : A portable workflow for Genome Wide Association Studies. bioRxiv. (2022). doi: 10.1101/2022.05.02.490206v2
60. Sanger imputation service. Available online at: https://imputation.sanger.ac.uk/ (Accessed April 23, 2023).
61. Ruan Y, Lin YF, Feng YCA, Chen CY, Lam M, Guo Z, et al. Improving polygenic prediction in ancestrally diverse populations. Nat Genet. (2022) 54:573. Available online at: https://pmc.ncbi.nlm.nih.gov/articles/PMC9117455/.
62. R Core Team. R A Language and Environment for Statistical Computing. Vienna: R Foundation for Statistical Computing (2021). Available online at: https://www.R-project.org/ (Accessed July 21, 2024).
63. Kalungi A, Kinyanda E, Akena DH, Gelaye B, Ssembajjwe W, Mpango RS, et al. Prevalence and correlates of common mental disorders among participants of the Uganda Genome Resource: Opportunities for psychiatric genetics research. Mol Psychiatry. (2024) 30:122. Available online at: https://pmc.ncbi.nlm.nih.gov/articles/PMC11649557/.
64. Çorbacıoğlu ŞK and Aksel G. Receiver operating characteristic curve analysis in diagnostic accuracy studies: A guide to interpreting the area under the curve value. Turk J Emerg Med. (2023) 23:195. Available online at: https://pmc.ncbi.nlm.nih.gov/articles/PMC10664195/.
65. Wang H, Wang B, Zhang X, and Feng C. Relations among sensitivity, specificity and predictive values of medical tests based on biomarkers. Gen Psychiatr. (2021) 34:100453. Available online at: https://gpsych.bmj.com/content/34/2/e100453 (Accessed January 21, 2025).
66. Rukundo GZ, Mishara BL, and Kinyanda E. Burden of suicidal ideation and attempt among persons living with HIV and AIDS in Semiurban Uganda. AIDS Res Treat. (2016) 2016. doi: 10.1155/2016/3015468
67. Tsai YT, Padmalatha S, Ku HC, Wu YL, Yu T, Chen MH, et al. Suicidality among people living with HIV from 2010 to 2021: A systematic review and a meta-regression. Psychosom Med. (2022) 84:924–39. doi: 10.1097/PSY.0000000000001127
68. Cai H, Xie XM, Zhang Q, Cui X, Lin JX, Sim K, et al. Prevalence of suicidality in major depressive disorder: A systematic review and meta-analysis of comparative studies. Front Psychiatry. (2021) 12:690130. Available online at: https://pmc.ncbi.nlm.nih.gov/articles/PMC8481605/.
69. Vaquero-Lorenzo C and Vasquez MA. Suicide: genetics and heritability. Curr Top Behav Neurosci. (2020) 46:63–78. doi: 10.1007/7854_2020_161
70. Van Heeringen K. Stress–diathesis model of suicidal behavior. In: The Neurobiological Basis of Suicide. Boca Raton (FL): CRC Press/Taylor & Francis. (2012). p. 113–23. Available online at: https://www.ncbi.nlm.nih.gov/books/NBK107203/.
71. Su R, John JR, and Lin PI. Machine learning-based prediction for self-harm and suicide attempts in adolescents. Psychiatry Res. (2023) 328:115446. doi: 10.1016/j.psychres.2023.115446
72. Bazrafshan M and Sayehmiri K. Predicting suicidal behavior outcomes: an analysis of key factors and machine learning models. BMC Psychiatry. (2024) 24:841. Available online at: https://pmc.ncbi.nlm.nih.gov/articles/PMC11583731/.
Keywords: suicidality, prediction, machine learning, polygenic risk scores, HIV
Citation: Mutema AB, Linda L, Jjingo D, Fatumo S, Kinyanda E and Kalungi A (2025) Predicting suicidality in people living with HIV in Uganda: a machine learning approach. Front. Psychiatry 16:1584335. doi: 10.3389/fpsyt.2025.1584335
Received: 27 February 2025; Accepted: 29 July 2025;
Published: 15 August 2025.
Edited by:
Bing Liu, Beijing Normal University, ChinaReviewed by:
Daniel Levey, Yale University, United StatesPaddy Ssentongo, The Pennsylvania State University (PSU), United States
Copyright © 2025 Mutema, Linda, Jjingo, Fatumo, Kinyanda and Kalungi. This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.
*Correspondence: Anthony B. Mutema, YWJtdXRlbWFAZ21haWwuY29t; Allan Kalungi, YWxsYW4ua2FsdW5naUBtcmN1Z2FuZGEub3Jn