Related Experiment Video
Updated: Sep 13, 2026

Implementation of a Real-Time Psychosis Risk Detection and Alerting System Based on Electronic Health Records using CogStack
Published on: May 15, 2020
Predicting clozapine initiation among patients with schizophrenia via machine learning trained on electronic health
Erik Perfalk1, Jakob Grøhn Damgaard2, Andreas Aalkjær Danielsen3
1Department of Affective Disorders, Aarhus University Hospital, Aarhus, Denmark; Department of Clinical Medicine, Aarhus University, Aarhus, Denmark.
Background:
Clozapine is the only medication with proven efficacy for treatment-resistant schizophrenia, yet many patients experience delays of several years before initiation. Our aim was to develop and validate a dynamic prediction model for clozapine initiation among patients with schizophrenia trained solely on electronic health record (EHR) data from routine clinical practice.
Study Design:
EHR data from all adults (≥18 years) with a schizophrenia (ICD10: F20) or schizoaffective disorder (ICD10: F25) diagnosis who had been in contact with the Psychiatric Services of the Central Denmark Region between 1 January 2013 and 1 June 2024 were retrieved. 179 structured predictors were engineered (covering, e.g., diagnoses, medications, coercive measures) and 750 predictors derived from clinical notes. At every psychiatric hospital visit, we predicted if an incident clozapine prescription occurred within the next 365 days. XGBoost and logistic regression models were trained on 85% of the data with 5-fold stratified cross-validation. Performance was evaluated on the remaining 15% of the data (held out) using the area under the receiver operating characteristic curve (AUROC).
Study Results:
The training/test set comprised of 194,234/35,527 hospital visits, distributed on 4928/878 unique patients. In the test set, the best XGBoost model achieved an AUROC of 0.81, sensitivity of 42%, positive predictive value of 23% at a 7.5% predicted positive rate.
Conclusions:
A dynamic prediction model based solely on EHR data predicts clozapine initiation with high discrimination. If implemented as a clinical decision support tool, this model may guide clinicians towards more timely initiation of clozapine treatment.