Related Experiment Video
Updated: Mar 24, 2026

Implementation of a Real-Time Psychosis Risk Detection and Alerting System Based on Electronic Health Records using CogStack
Published on: May 15, 2020
Establishment and Validation of Machine Learning Model for Predicting Suicide Risk in Patients with Major Depressive
Hang Tan1, Zhanjin Wang2, Jie Ma1
1Department of Nursing, The Affiliated Hospital of Qinghai University, Xining, People's Republic of China.
Background:
Suicide, a serious outcome in major depressive disorder (MDD), necessitates early risk detection for clinical intervention. This study developed machine learning models to predict suicide risk in MDD patients.The model incorporated both psychological (eg,the Hamilton Anxiety Rating Scale[HAMA], the Clinical Global Impression of Severity Scale [CGI-S]) and biological (eg, thyroid-stimulating hormone [TSH], Systolic blood pressure[SBP]) predictors, with CGI-S, HAMA, and SBP emerging as the top predictors.
Patients And Methods:
We analyzed data from 1,718 first-episode medicated patients with MDD recruited from the psychiatric outpatient department of the First Affiliated Hospital of Shanxi Medical University (March 2016-June 2017). Feature selection was performed using Least absolute shrinkage and selection operator (LASSO) regression, and the importance of the selected features was ranked using SHAP values via the XGBoost algorithm. The features were incrementally incorporated into the model construction based on their importance. Eleven machine-learning algorithms were evaluated, and an optimized stacked ensemble model was developed using a stacking algorithm. Model performance was assessed using Receiver Operating Characteristic Curve, precision-recall (PR) curves, accuracy, recall, and F1 scores. Interpretability was enhanced using kernel-SHAP and LIME algorithms.
Results:
The Cohort comprised 1,718 MDD patients (mean age 34.87 ± 12.43 years; 34.20% male). Eight key predictors were selected: CGI-S score, HAMA score, TSH, SBP, PANSS positive subscale score, Antithyroglobulin, Diastolic blood pressure (DBP) and age. The top predictors, included CGI-S, HAMA, and SBP, aligning with pathways involving autonomic dysregulation and anxiety-depression interplay. The stacked ensemble model demonstrated superior performance, achieving an Area Under Curve of 0.868 and a PR value of 0.665 on the test set, outperforming all the other models. Decision curve analysis (DCA) confirmed its clinical utility, showing the highest net benefit across a risk threshold range of 0.03-0.88. The SHAP method improved model interpretability and highlighted influential predictors.
Conclusion:
The stacked ensemble model exhibited a strong predictive performance and clinical applicability for suicide risk assessment in patients with MDD. This tool may aid clinicians in the early identification and intervention of high-risk individuals and potentially improve patient outcomes.

