Skip to main content
medRxiv
  • Home
  • About
  • Submit
  • ALERTS / RSS
Advanced Search

Predicting the need for electroconvulsive therapy via machine learning trained on electronic health record data

View ORCID ProfileLasse Hansen, View ORCID ProfileJakob Grøhn Damgaard, View ORCID ProfileRobert M. Lundin, View ORCID ProfileAndreas Aalkjær Danielsen, View ORCID ProfileSøren Dinesen Østergaard
doi: https://doi.org/10.1101/2025.06.19.25329678
Lasse Hansen
1Department of Clinical Medicine, Aarhus University, Aarhus, Denmark
2Department of Affective Disorders, Aarhus University Hospital - Psychiatry, Aarhus, Denmark
3Center for Humanities Computing, Aarhus University, Aarhus, Denmark
PhD
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Lasse Hansen
Jakob Grøhn Damgaard
1Department of Clinical Medicine, Aarhus University, Aarhus, Denmark
2Department of Affective Disorders, Aarhus University Hospital - Psychiatry, Aarhus, Denmark
3Center for Humanities Computing, Aarhus University, Aarhus, Denmark
MSc
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Jakob Grøhn Damgaard
Robert M. Lundin
4Deakin University, Institute for Mental and Physical Health and Clinical Translation (IMPACT), Geelong, Victoria, Australia
5Mildura Base Public Hospital Mental Health Services, Alcohol and Other Drugs Integrated Treatment Team, Victoria, Australia
6Barwon Health, Drugs and Alcohol Services, Mental Health Drugs and Alcohol Services, Geelong, Victoria, Australia
MD
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Robert M. Lundin
Andreas Aalkjær Danielsen
1Department of Clinical Medicine, Aarhus University, Aarhus, Denmark
2Department of Affective Disorders, Aarhus University Hospital - Psychiatry, Aarhus, Denmark
7Psychosis Research Unit, Aarhus University Hospital - Psychiatry, Aarhus, Denmark
MDPhD
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Andreas Aalkjær Danielsen
Søren Dinesen Østergaard
1Department of Clinical Medicine, Aarhus University, Aarhus, Denmark
2Department of Affective Disorders, Aarhus University Hospital - Psychiatry, Aarhus, Denmark
4Deakin University, Institute for Mental and Physical Health and Clinical Translation (IMPACT), Geelong, Victoria, Australia
MDPhD
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Søren Dinesen Østergaard
  • For correspondence: soeoes{at}rm.dk
  • Abstract
  • Full Text
  • Info/History
  • Metrics
  • Supplementary material
  • Preview PDF
Loading

Abstract

Objective Electroconvulsive therapy (ECT) is an effective treatment of severe manifestations of mental illness. Since delay in initiation of ECT can have detrimental effects, prediction of the need for ECT could improve outcomes via more timely treatment initiation. This study aimed to predict the need for ECT following admission to a psychiatric hospital.

Methods This cohort study was based on electronic health record (EHR) data from routine clinical practice. Adult patients admitted to a hospital within the Psychiatric Services of the Central Denmark Region between January 2013 and November 2021 were included in the study. The outcome was initiation of ECT >7 days (to not include patients admitted for planned ECT) and ≤67 days after admission. The data was randomly split into an 85% training set and a 15% test set. On the 7th day of the inpatient stay, machine learning models (extreme gradient boosting (XGBoost)) were trained to predict initiation of ECT and subsequently tested on the test set, using the area under the receiver operating characteristic curve (AUROC) as the main performance measure.

Results The cohort consisted of 41,610 patients with 164,961 admissions eligible for prediction. In the test set the trained model predicted ECT initiation with an AUROC of 0.94, 47% sensitivity, 98% specificity, positive predictive value of 24% and negative predictive value of 99%. The top predictors were the highest suicide assessment score and the mean Brøset violence checklist score in the preceding three months.

Conclusions EHR data from routine clinical practice can be used to predict need for ECT. This may lead to more timely treatment initiation.

Competing Interest Statement

Dr Danielsen reported receiving personal fees from Otsuka Pharma Scandinavia AB outside the submitted work. Dr Ostergaard reported receiving grants from The Novo Nordisk Foundation (grant No. NNF20SA0062874), The Lundbeck Foundation (grant No. R358-2020-2341), and Independent Research Fund Denmark (grant Nos. 7016-00048B and 2096-00055A); receiving the 2020 Lundbeck Foundation Young Investigator Prize; owning or having owned units of mutual funds with stock tickers DKIGI, IAIMWC, SPIC25KL and WEKAFKI; and owning or having owned units of exchange traded funds with stock tickers BATE, TRET, QDV5, QDVH, QDVE, SADM, IQQH, USPY, EXH2, 2B76, IS4S, OM3X, EUNL and SXRV outside the submitted work. No other disclosures were reported.

Funding Statement

The study is supported by grants from the Lundbeck Foundation (grant No. R344-2020-1073 to Dr Ostergaard), the Danish Cancer Society (grant No. R283-A16461 to Dr Ostergaard), the Central Denmark Region Fund for Strengthening of Health Science (grant No. 1-36-72-4-20 to Dr Ostergaard), and the Danish Agency for Digitisation Investment Fund for New Technologies (grant No. 2020-6720 to Dr Ostergaard).

Author Declarations

I confirm all relevant ethical guidelines have been followed, and any necessary IRB and/or ethics committee approvals have been obtained.

Yes

The details of the IRB/oversight body that provided approval or exemption for the research described are given below:

The Central Denmark Region Committees on Health Research Ethics waived ethical approval for this work (no: 1-10-72-1-22).

I confirm that all necessary patient/participant consent has been obtained and the appropriate institutional forms have been archived, and that any patient/participant/sample identifiers included were not known to anyone (e.g., hospital staff, patients or participants themselves) outside the research group so cannot be used to identify individuals.

Yes

I understand that all clinical trials and any other prospective interventional studies must be registered with an ICMJE-approved registry, such as ClinicalTrials.gov. I confirm that any such study reported in the manuscript has been registered and the trial registration ID is provided (note: if posting a prospective study registered retrospectively, please provide a statement in the trial ID field explaining why the study was not registered in advance).

Yes

I have followed all appropriate research reporting guidelines, such as any relevant EQUATOR Network research reporting checklist(s) and other pertinent material, if applicable.

Yes

Copyright 
The copyright holder for this preprint is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. It is made available under a CC-BY-NC-ND 4.0 International license.
Back to top
PreviousNext
Posted June 20, 2025.
Download PDF

Supplementary Material

Email

Thank you for your interest in spreading the word about medRxiv.

NOTE: Your email address is requested solely to identify you as the sender of this article.

Enter multiple addresses on separate lines or separate them with commas.
Predicting the need for electroconvulsive therapy via machine learning trained on electronic health record data
(Your Name) has forwarded a page to you from medRxiv
(Your Name) thought you would like to see this page from the medRxiv website.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Share
Predicting the need for electroconvulsive therapy via machine learning trained on electronic health record data
Lasse Hansen, Jakob Grøhn Damgaard, Robert M. Lundin, Andreas Aalkjær Danielsen, Søren Dinesen Østergaard
medRxiv 2025.06.19.25329678; doi: https://doi.org/10.1101/2025.06.19.25329678
Twitter logo Facebook logo LinkedIn logo Mendeley logo
Citation Tools
Predicting the need for electroconvulsive therapy via machine learning trained on electronic health record data
Lasse Hansen, Jakob Grøhn Damgaard, Robert M. Lundin, Andreas Aalkjær Danielsen, Søren Dinesen Østergaard
medRxiv 2025.06.19.25329678; doi: https://doi.org/10.1101/2025.06.19.25329678

Citation Manager Formats

  • BibTeX
  • Bookends
  • EasyBib
  • EndNote (tagged)
  • EndNote 8 (xml)
  • Medlars
  • Mendeley
  • Papers
  • RefWorks Tagged
  • Ref Manager
  • RIS
  • Zotero
  • Tweet Widget
  • Facebook Like
  • Google Plus One

Subject Area

  • Psychiatry and Clinical Psychology
Subject Areas
All Articles
  • Addiction Medicine (576)
  • Allergy and Immunology (868)
  • Anesthesia (306)
  • Cardiovascular Medicine (4483)
  • Dentistry and Oral Medicine (449)
  • Dermatology (385)
  • Emergency Medicine (615)
  • Endocrinology (including Diabetes Mellitus and Metabolic Disease) (1528)
  • Epidemiology (15283)
  • Forensic Medicine (31)
  • Gastroenterology (1134)
  • Genetic and Genomic Medicine (6651)
  • Geriatric Medicine (671)
  • Health Economics (1006)
  • Health Informatics (4606)
  • Health Policy (1378)
  • Health Systems and Quality Improvement (1624)
  • Hematology (545)
  • HIV/AIDS (1276)
  • Infectious Diseases (except HIV/AIDS) (15965)
  • Intensive Care and Critical Care Medicine (1111)
  • Medical Education (626)
  • Medical Ethics (147)
  • Nephrology (675)
  • Neurology (6699)
  • Nursing (346)
  • Nutrition (1006)
  • Obstetrics and Gynecology (1153)
  • Occupational and Environmental Health (961)
  • Oncology (3370)
  • Ophthalmology (989)
  • Orthopedics (370)
  • Otolaryngology (421)
  • Pain Medicine (437)
  • Palliative Medicine (131)
  • Pathology (670)
  • Pediatrics (1704)
  • Pharmacology and Therapeutics (700)
  • Primary Care Research (717)
  • Psychiatry and Clinical Psychology (5497)
  • Public and Global Health (9288)
  • Radiology and Imaging (2225)
  • Rehabilitation Medicine and Physical Therapy (1375)
  • Respiratory Medicine (1202)
  • Rheumatology (598)
  • Sexual and Reproductive Health (721)
  • Sports Medicine (536)
  • Surgery (722)
  • Toxicology (100)
  • Transplantation (290)
  • Urology (267)