Previously submitted to: JMIR Mental Health (no longer under consideration since Jan 30, 2026)
Date Submitted: Jan 26, 2026
Warning: This is an author submission that is not peer-reviewed or edited. Preprints - unless they show as "accepted" - should not be relied on to guide clinical practice or health-related behavior and should not be reported in news media as established information.
Predicting Delayed Antidepressant Initiation During Hospitalization Using Early Electronic Health Record Data: A Machine Learning Study
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.
Citation
Request queued. Please wait while the file is being generated. It may take some time.
Copyright
© The authors. All rights reserved. This is a privileged document currently under peer-review/community review (or an accepted/rejected manuscript). Authors have provided JMIR Publications with an exclusive license to publish this preprint on it's website for review and ahead-of-print citation purposes only. While the final peer-reviewed paper may be licensed under a cc-by license on publication, at this stage authors and publisher expressively prohibit redistribution of this draft paper other than for review purposes.