Development of an emergency department length-of-stay prediction model based on machine learning

World J Emerg Med. 2025 May 1;16(3):220-224. doi: 10.5847/wjem.j.1920-8642.2025.048.

Abstract

Background: The problem of prolonged emergency department length of stay (EDLOS) is becoming increasingly crucial. This study aims to develop a machine learning (ML) model to predict EDLOS, with EDLOS as the outcome variable and demographic characteristics, triage level, and medical resource utilization as predictive factors.

Methods: A retrospective analysis was performed on the patients who visited the emergency department of the Second Affiliated Hospital of Guangzhou Medical University from March 2019 to September 2021, and a total of 321,012 cases were identified. According to the inclusion and exclusion criteria, 187,028 cases were finally included in the analysis. ML analysis was performed using R-squared (R2), and the predictive factors and the EDLOS were used as independent variables and dependent variables, respectively, to establish models. The performance evaluation of the ML models was conducted through the utilization of the mean absolute error (MAE), root mean square error (RMSE), and R2, enabling an objective comparative analysis.

Results: In the comparative analysis of the six ML models, light gradient boosting machine (LightGBM) model demonstrated the lowest MAE (443.519) and RMSE (826.783), and the highest R² value (0.48), indicating better model fit and predictive performance. Among the top 10 predictive factors associated with EDLOS according to the LightGBM model, the emergency waiting time, age, and emergency arrival time had the most significant impact on the EDLOS.

Conclusion: The LightGBM model suggests that the emergency waiting time, age, and emergency arrival time may be used to predict the EDLOS.

Keywords: Emergency department; Length of stay; Light gradient boosting machine; Machine learning.