Predicting Delayed Antidepressant Initiation During Hospitalization Using Early Electronic Health Record Data: A Machine Learning Study (Preprint)

Read full text
Authors: Hung-Min Huang, Chun-Shun Lu, Geng-Wei Chang
Cited by: 0

Abstract

BACKGROUND Psychological distress is common among hospitalized patients but remains difficult to identify reliably in routine clinical care. Many electronic health record (EHR)–based prediction models rely on diagnostic codes, which are heterogeneous and poorly suited for early risk stratification. OBJECTIVE To develop and internally validate a machine learning model that predicts delayed initiation of antidepressant therapy as a proxy for clinician-recognized psychological deterioration, using EHR data available within the first 24 hours of hospital admission. METHODS A retrospective cohort study was conducted using the MIMIC-IV database. The outcome was initiation of a new antidepressant prescription occurring more than 24 hours after admission, with all prior antidepressant users excluded. Predictors were restricted to early demographic, clinical, laboratory, medication, and workflow-derived care-intensity features. Gradient-boosted decision trees and regularized logistic regression models were trained using subject-level data partitioning. Model performance was evaluated using the area under the receiver operating characteristic curve (AUROC), area under the precision–recall curve (AUPRC), log loss, Brier score and calibration plot. Bootstrap resampling was used to estimate confidence intervals. RESULTS Among 546,028 admissions representing 223,452 patients, 20,858 admissions (3.8%) met the outcome definition. The gradient-boosted model achieved an AUROC of 0.793 on the subject-level test set, outperforming logistic regression (AUROC 0.695). AUPRC values were 0.129 and 0.085, respectively, reflecting outcome rarity and heterogeneity. Bootstrap estimates showed negligible variability in AUROC. Feature importance analysis indicated that predictive signal arose from a combination of baseline vulnerability, early physiological stress, medication exposure patterns, and workflow-derived care-intensity measures. CONCLUSIONS Early EHR data contain meaningful signal associated with subsequent antidepressant initiation during hospitalization. Modelling treatment initiation as a pragmatic proxy enables early risk stratification without reliance on diagnostic codes. Workflow-derived features modestly improve predictive performance, supporting their role as complementary indicators of psychological vulnerability in hospitalized patients.

Fields of Study & Subjects

Machine Learning in Healthcare Artificial Intelligence in Healthcare Electronic Health Records Systems

Publication details

Publication date
26 January 2026
Document type
Preprint