Abstract
Background: Accurate predictions of discharge timing and in-hospital mortality could improve hospital efficiency, but clinician estimates are often inconsistent and imprecise. We evaluated if machine learning models could concurrently predict in-hospital mortality and length of stay (LoS) more reliably. Methods: We used electronic healthcare data from 01-November-2021 to 31-October-2024 from Oxfordshire, UK, using two years of data for training and evaluating models using the final year's data. The performance of task-specific extreme gradient boosting (XGB), logistic regression (LR), and multilayer-perceptron (MLP) models for the two tasks: (i) mortality prediction and (ii) LoS prediction, were compared with that of a single multiclass XGB model predicting combinations of LoS and mortality, and an MLP-based multi-task learning model predicting both outcomes simultaneously. Predictions from the best-performing models were compared to discharge predictions made by clinicians. Findings: Clinicians provided relevant discharge predictions for only 3-5% of admissions, mostly close to discharge. Task-specific XGB models achieved an area under the receiver operating curve of 0.92 and 0.92 for predicting mortality, and 0.83 and 0.72 for predicting LoS quartiles, in elective and emergency admissions respectively, outperforming task-specific LR and MLP models. Neither the multiclass XGB nor the MLP-based multi-task models, predicting both outcomes simultaneously, consistently improved performance. The best-performing task-specific XGB models matched clinician LoS prediction accuracy in elective admissions, and significantly outperformed clinicians in emergency admissions (p<0.001). Interpretation: Machine learning models can predict in-hospital mortality and LoS as well or better than clinicians and have potential to enhance discharge planning and hospital resource management.
Competing Interest Statement
The authors have declared no competing interest.
Funding Statement
This study was funded by the National Institute for Health Research (NIHR) Biomedical Research Centre, Oxford and the NIHR Health Protection Research Unit in Healthcare Associated Infections and Antimicrobial Resistance at Oxford University in partnership with the UK Health Security Agency (UKHSA) (NIHR200915). The views expressed in this publication are those of the authors and not necessarily those of the NHS, the National Institute for Health Research, the Department of Health and Social Care or the UKHSA. ASW is an NIHR Senior Investigator. DWE is a Robertson Foundation Fellow. The funders had no role in in study design; in the collection, analysis, and interpretation of data; in the writing of the report; or in the decision to submit the paper for publication.
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:
Deidentified data were obtained from the Infections in Oxfordshire Research Database which has approvals from the National Research Ethics Service South Central-Oxford C Research Ethics Committee (19/SC/0403), the Health Research Authority and the National Confidentiality Advisory Group (19/CAG/0144), including provision for use of pseudonymised routinely collected data without individual patient consent. Patients who choose to opt out of their data being used in research are not included in the study. The study was carried out in accordance with all relevant guidelines and regulations.
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
The Chan Zuckerberg Initiative, Cold Spring Harbor Laboratory, the Sergey Brin Family Foundation, California Institute of Technology, Centre National de la Recherche Scientifique, Fred Hutchinson Cancer Center, Imperial College London, Massachusetts Institute of Technology, Stanford University, University of Washington, and Vrije Universiteit Amsterdam.