TY - JOUR
T1 - Predicting depression among men who have sex with men in Ghana using machine learning algorithms
AU - Anafo, Abdulzeid Yen
AU - Nelson, La Ron E.
AU - Wilton, Leo
AU - Gmayinaam, Vincent Uwumboriyhie
AU - Ocloo, Selasi
N1 - Publisher Copyright:
© 2025 Anafo et al. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution,
PY - 2025/11
Y1 - 2025/11
N2 - Men who have sex with men (MSM) in Ghana face heightened risks of depression due to pervasive stigma, social exclusion, and legal discrimination. Despite this, depression remains underdiagnosed and undertreated in this population. This study applied seven tree-based machine learning (ML) models using tree-based classifiers: Decision Tree, Random Forest, Gradient Boosting, AdaBoost, XGBoost, LightGBM, and CatBoost to identify key psychosocial predictors of depression in a sample of 225 MSM aged 18–60 years. The dataset included sociodemographic variables, perceived stress (PSS), social isolation (internal and external), behavioural risk indicators, and stigma-related measures. After handling missing values, data were pre-processed with feature standardization and one-hot encoding. The Synthetic Minority Over-Sampling Technique was applied to address class imbalance. Model performance was evaluated using 5-fold cross-validation and metrics such as accuracy, precision, recall, F1 score, and ROC AUC. Among all models, Random Forest achieved the highest accuracy for the prediction of depression amongst MSM in Ghana. Feature importance analysis revealed that external social isolation (ExtSocialIso2), perceived stress (PSS14), and stigma due to same-sex behaviour (StigmaSSB9) were the most consistent predictors of depression. Variables related to resilience, gender non-conformity stigma, and sense of community belonging also contributed significantly. Depression among MSM in Ghana is closely linked to social isolation, stress, and identity-based stigma. Machine learning models, especially ensemble methods, can effectively identify individuals at risk. These findings underscore the need for culturally tailored mental health interventions and inclusive policies that address stigma and promote social support among MSM in Ghana.
AB - Men who have sex with men (MSM) in Ghana face heightened risks of depression due to pervasive stigma, social exclusion, and legal discrimination. Despite this, depression remains underdiagnosed and undertreated in this population. This study applied seven tree-based machine learning (ML) models using tree-based classifiers: Decision Tree, Random Forest, Gradient Boosting, AdaBoost, XGBoost, LightGBM, and CatBoost to identify key psychosocial predictors of depression in a sample of 225 MSM aged 18–60 years. The dataset included sociodemographic variables, perceived stress (PSS), social isolation (internal and external), behavioural risk indicators, and stigma-related measures. After handling missing values, data were pre-processed with feature standardization and one-hot encoding. The Synthetic Minority Over-Sampling Technique was applied to address class imbalance. Model performance was evaluated using 5-fold cross-validation and metrics such as accuracy, precision, recall, F1 score, and ROC AUC. Among all models, Random Forest achieved the highest accuracy for the prediction of depression amongst MSM in Ghana. Feature importance analysis revealed that external social isolation (ExtSocialIso2), perceived stress (PSS14), and stigma due to same-sex behaviour (StigmaSSB9) were the most consistent predictors of depression. Variables related to resilience, gender non-conformity stigma, and sense of community belonging also contributed significantly. Depression among MSM in Ghana is closely linked to social isolation, stress, and identity-based stigma. Machine learning models, especially ensemble methods, can effectively identify individuals at risk. These findings underscore the need for culturally tailored mental health interventions and inclusive policies that address stigma and promote social support among MSM in Ghana.
UR - https://www.scopus.com/pages/publications/105027670996
U2 - 10.1371/journal.pmen.0000485
DO - 10.1371/journal.pmen.0000485
M3 - Article
AN - SCOPUS:105027670996
SN - 2837-8156
VL - 2
JO - PLOS Mental Health
JF - PLOS Mental Health
IS - 11 November
M1 - e0000485
ER -