Multidimensional Suicide Risk Assessment with Machine Learning using Electronic Health Records
Organizations: Nexcepta, Gaithersburg, MD, USA · United States Military Academy, West Point, NY, USA
Abstract
Suicide prevention remains a critical public health challenge, and electronic health records (EHRs) provide an opportunity to characterize suicide-related risk indicators using documented clinical, behavioral, medical, and social-contextual information. This paper presents a multidimensional machine learning framework to model and estimate suicide-related outcomes using MIMIC-IV EHR data. We construct clinically motivated diagnosis categories and define a composite outcome from documented codes corresponding to suicidal ideation, suicide attempt, prior suicidal behavior, and intentional self-harm. To address severe class imbalance and reduce age-related confounding, we apply age-matched resampling that retains all positive patients and samples comparison-cohort patients from the same age group. Logistic regression, random forest, and XGBoost classifiers are evaluated before and after resampling with isotonic calibration. The calibrated XGBoost model achieves the strongest matched-cohort performance, outperforming the other evaluated classifiers. SHAP-based interpretation shows that diagnostic burden, depression-related features, age, personality-disorder history, social determinants related to violence, and medical comorbidity contribute to elevated predicted probabilities. Our results demonstrate that combining broad EHR-derived features, age-matched cohort construction, calibration, and feature-level interpretation provides a practical framework for retrospective suicide-related risk modeling.
Figures & tables
| Feature | High-Risk Cohort Rate | Control Cohort Rate | Odds Ratio |
|---|---|---|---|
| SDOH Violence | 29.6% | 1.2% | 34.62 |
| Mood Disorders | 18.8% | 0.9% | 26.13 |
| PTSD | 21.3% | 1.6% | 17.03 |
| SDOH Housing | 17.6% | 1.3% | 16.62 |
| Depression | 75.6% | 16.6% | 15.53 |
| Personality Disorders | 26.7% | 2.8% | 12.60 |
| Feature | High-Risk Cohort Rate | Control Cohort Rate | Odds Ratio |
|---|---|---|---|
| Cancer | 7.9% | 22.2% | 0.30 |
| Vascular | 13.1% | 31.3% | 0.33 |
| Cardiovascular | 35.9% | 61.9% | 0.34 |
| Hematologic Malignancy | 0.8% | 2.3% | 0.35 |
| Endocrine | 29.1% | 52.8% | 0.37 |
| Procedural Status | 7.7% | 16.6% | 0.42 |
| Model | Feature | Values Tested |
|---|---|---|
| Logistic Regression | C | 0.01, 0.1, 1, 10 |
| Logistic Regression | Penalty | L1, L2 |
| Random Forest | num estimators | 200, 400 |
| Random Forest | max depth | None, 20, 30 |
| Random Forest | min samples split | 2, 5 |
| XGBoost | num estimators | 100, 200, 300 |
| Model | Precision | Recall | F1 | AUPRC | AUROC |
|---|---|---|---|---|---|
| Logistic Regression (Before) | 0.7282 | 0.4475 | 0.5543 | 0.6567 | 0.9543 |
| Logistic Regression (After) | 0.7781 | 0.7782 | 0.7816 | 0.8377 | 0.9343 |
| Random Forest (Before) | 0.7429 | 0.5350 | 0.6220 | 0.6896 | 0.9614 |
| Random Forest (After) | 0.8157 | 0.7812 | 0.7981 | 0.8701 | 0.9501 |
| XGBoost (Before) | 0.8175 | 0.5799 | 0.6785 | 0.7573 | 0.9603 |
| XGBoost (After) | 0.8434 | 0.7806 | 0.8108 | 0.8891 | 0.9533 |
| Age Group | Test Size | Precision | Recall | F1 Score |
|---|---|---|---|---|
| 18–25 | 4601 | 0.8418 | 0.8330 | 0.8374 |
| 26–35 | 2696 | 0.8547 | 0.8027 | 0.8279 |
| 36–45 | 2167 | 0.8466 | 0.7841 | 0.8142 |
| 46–55 | 1993 | 0.8620 | 0.7651 | 0.8106 |
| 56–65 | 1207 | 0.8171 | 0.6953 | 0.7513 |
| 66–75 | 463 | 0.7917 | 0.6552 | 0.7170 |
| Metric | Average Value | 95% CI Lower Bound | 95% CI Upper Bound |
|---|---|---|---|
| Precision | 0.8368 | 0.8335 | 0.8401 |
| Recall | 0.7779 | 0.7744 | 0.7814 |
| F1 Score | 0.8062 | 0.8042 | 0.8083 |
| AUPRC | 0.8904 | 0.8888 | 0.8921 |
| AUROC | 0.9545 | 0.9539 | 0.9552 |
| Feature | Mean Abs. SHAP | SD | CV |
|---|---|---|---|
| Total diagnoses | 0.2176 | 0.0115 | 0.0528 |
| Has depression | 0.0900 | 0.0077 | 0.0858 |
| Count depression | 0.0818 | 0.0055 | 0.0674 |
| Age 76–85 | 0.0593 | 0.0128 | 0.2164 |
| Has Personality Disorders | 0.0570 | 0.0070 | 0.1220 |
| Has SDOH Violence | 0.0496 | 0.0093 | 0.1869 |
Suicide Risk Modeling
Suicide risk modeling uses clinical, behavioral, and language data to estimate, explain, and forecast suicidal thoughts or actions.
See all 20 papers