Concurrent prediction of in-hospital mortality and length of stay using single-task, multiclass and multitask machine learning

Wei J., Gay J., Brent A., Clifton D., Walker S., Eyre D.

Objectives 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 and analysis We used electronic healthcare data from 1 November 2021 to 31 October 2024 from Oxfordshire, UK, using 2 years’ data for training and evaluating models using the final year’s data. The performance of task-specific extreme gradient boosting (XGB), logistic regression (LR), multilayer perceptron (MLP) and TabNet models for two tasks, mortality prediction and LoS prediction, was compared with a single multiclass XGB model predicting combinations of LoS and mortality and MLP and TabNet-based multitask learning model predicting both outcomes simultaneously. Predictions from the best-performing models were compared with discharge predictions made by clinicians. Results 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, MLP and TabNet models. Neither the multiclass XGB nor the MLP or TabNet-based multitask 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). Conclusion Machine learning models can predict in-hospital mortality and LoS as well or better than clinicians, especially for emergency admissions. These models have the potential to be implemented in hospital settings, providing consistent predictions and thus enhancing discharge planning and hospital resource management.

DOI

10.1136/bmjdhai-2025-000071

Type

Journal article

Publisher

BMJ

Publication Date

2025-12-01T00:00:00+00:00

Volume

1

Pages

e000071 - e000071

Permalink More information Close