Related Experiment Video
Updated: Aug 28, 2026

Implementation of a Real-Time Psychosis Risk Detection and Alerting System Based on Electronic Health Records using CogStack
Published on: May 15, 2020
Development and evaluation of machine learning models to predict mechanical restraint and related coercive measures
Sara Kolding1,2,3, Jakob Grøhn Damgaard1,2,3, Martin Bernstorff1,2,3
1Department of Affective Disorders, Aarhus University Hospital, Aarhus, Denmark.
Purpose:
Coercive practices in psychiatric hospitals present clinical and ethical challenges. Aiming to support prevention, we developed and evaluated machine learning models predicting mechanical restraint and a composite of related coercive measures.
Materials And Methods:
The dataset comprised electronic health records from adults admitted to the Psychiatric Services in the Central Denmark Region (2015-2021). For each inpatient day, an XGBoost model predicted mechanical restraint or composite (mechanical, chemical, or manual) restraint within 48 h. Hyperparameters were optimised for the area under the receiver operating characteristic curve (AUROC) using five-fold cross-validation on 85% of the data and validated on a held-out 15% test set.
Results:
The cohort included 16,834 patients with 45,179 inpatient stays, covering 687,388 prediction days. 2,736 days were followed by restraint within 48 h, including 983 mechanical restraint episodes. Predictors were derived from demographics, diagnoses, medications, and clinical notes. The mechanical restraint model achieved an AUROC of 0.921 (95% CI: [0.921-0.924]) and a positive predictive value (PPV) of 4.9% at the top 1% risk threshold. The composite model yielded an AUROC of 0.912 (95% CI: [0.911-0.914]) and a PPV of 4.2% when predicting mechanical restraint, and 0.900 (95% CI: [0.899-0.901]) with a PPV of 10.4% for composite restraint.
Conclusion:
Incorporating related coercive measures into training did not improve AUROC for predicting mechanical restraint but increased PPV when predicting composite restraint, reflecting the higher outcome prevalence. This suggests related outcomes can inform prediction of rare events in clinical prediction modelling. Future work should include further validation.