Random Forest Classification of Suicide Risk Using Hopelessness, Defeat, Entrapment, and Psychological Pain - Mouhajir , Nabil; Abubaker, Mohammed; Saab, Thiago (Journal of Assessment and Research in Applied Counseling (JARAC), 2026)
Objective: This study aimed to develop and evaluate a Random Forest classification model for predicting suicide risk among Moroccan adults using hopelessness, defeat, entrapment, and psychological pain as psychological predictors. Methods and Materials: This cross-sectional predictive study was conducted among 1,284 adults from Morocco. Participants completed standardized self-report measures assessing suicide risk, hopelessness, defeat, entrapment, and psychological pain. Suicide risk was classified as a binary outcome variable, distinguishing low-risk and high-risk participants according to standardized suicide risk scores. Data were screened for missing values, distributional properties, and outliers before analysis. The dataset was divided into training and testing subsets using an 80:20 stratified split to preserve the proportion of suicide risk categories. A Random Forest classifier was trained on the training dataset, and hyperparameter tuning was performed using grid search with five-fold stratified cross-validation. Model performance was evaluated on the independent test dataset using accuracy, sensitivity, specificity, precision, F1-score, balanced accuracy, ROC-AUC, Cohen’s Kappa, Matthews Correlation Coefficient, and confusion matrix indices. Feature importance was examined using Gini importance, permutation importance, and SHAP-based interpretability analysis. Findings: Hopelessness, defeat, entrapment, and psychological pain were all positively associated with suicide risk, with psychological pain showing the strongest relationship. The optimized Random Forest model demonstrated excellent classification performance, with accuracy of 92.61%, sensitivity of 88.96%, specificity of 93.87%, precision of 90.74%, F1-score of 89.84%, balanced accuracy of 91.42%, and ROC-AUC of 0.964. Cohen’s Kappa was 0.819 and the Matthews Correlation Coefficient was 0.824, indicating strong agreement beyond chance. Feature-importance results showed that psychological pain was the strongest predictor, followed by entrapment, hopelessness, and defeat. SHAP analysis confirmed that higher levels of all four predictors increased the probability of classification into the high-suicide-risk group. Conclusion: The findings indicate that Random Forest classification can accurately distinguish suicide risk levels using theoretically grounded psychological variables. Psychological pain and entrapment were the most influential predictors, suggesting that unbearable emotional suffering and perceived inability to escape distress are central markers of elevated suicide risk. The model may provide a useful decision-support approach for suicide risk screening, although it should complement rather than replace professional clinical judgment.