The application of machine learning algorithms for predicting length of stay before and during the COVID-19 pandemic: evidence from Wuhan-area hospitals

Yang Liu, Renzhao Liang, Chengzhi ZhangFrontiers Digit. Health 2024

TL;DR

This study applies machine learning, particularly XGBoost, to predict patient Length of Stay (LOS) in hospitals before and during the COVID-19 pandemic. The research highlights medical insurance and out-of-pocket expenses as key predictors, offering valuable insights for hospital resource management and improved healthcare delivery.

What Problem Does This Paper Address?

The COVID-19 pandemic placed immense strain on healthcare systems globally, largely due to the unpredictable nature of patient Length of Stay (LOS). Accurately forecasting LOS is crucial for effective hospital resource allocation, ensuring sufficient beds and staff are available, especially during surges. Traditional methods for predicting LOS often struggle with the complexity and variability introduced by a pandemic. This paper aims to bridge this gap by identifying key factors influencing LOS and developing robust machine learning models to predict it, both in the pre-pandemic era and during the COVID-19 crisis in Wuhan.

Methods

The researchers employed a comparative approach using six machine learning algorithms: three linear regression models (Linear Regression, Lasso, Ridge) and three ensemble learning models (AdaBoost, Bagging, and XGBoost). They focused on identifying the most impactful variables from electronic medical records, ultimately selecting 35 features. The performance of these models was evaluated using standard regression metrics: Mean Absolute Error (MAE), Root Mean Square Error (RMSE), and Mean Absolute Percentage Error (MAPE). XGBoost, a gradient boosting algorithm known for its scalability and performance, was particularly highlighted.

Datasets

The study utilized electronic medical record data from Zhongnan Hospital of Wuhan University, a major regional teaching hospital that served as a leading center for COVID-19 patients in Wuhan. The dataset comprised approximately 158,854 patients from 2017-2019 (pre-pandemic) and 217,970 patients from 2020-2022 (during the pandemic). The data was categorized based on whether patients had Wuhan household registration or not, and whether they used medical insurance.

Key Insights and Ideas

  • Medical Insurance is King (for LOS prediction): Medical insurance status emerged as the most influential factor in predicting LOS, regardless of whether patients were from Wuhan or not. This underscores the significant role of financial access and coverage in healthcare utilization and duration.
  • Out-of-Pocket Costs Matter: The second most important predictor was the out-of-pocket amount. This suggests that financial strain directly impacts patient behavior, potentially leading to delayed care or less intensive treatments, thus extending LOS.
  • Pandemic Shifted the Landscape: The study observed a noticeable increase in prediction errors for medical insurance utilization during the pandemic. This is attributed to people staying home and not using their insurance as much. However, when insurance was used, errors were lower, suggesting its continued importance.
  • XGBoost Reigns Supreme: Among the tested algorithms, XGBoost consistently delivered the lowest error rates (MAE, RMSE, MAPE), demonstrating its superior ability to handle the complex data and predict LOS accurately.
  • Geographic Disparities in Healthcare Costs: Patients with non-Wuhan household registration incurred higher medical expenses when treated in Wuhan, leading to higher overall errors in prediction for this group. This highlights existing inequalities in healthcare access and spending.

Key Results

The study found that ensemble learning models generally outperformed linear regression models in prediction accuracy. XGBoost consistently achieved the best performance across both pre-pandemic and pandemic periods. For household registration in Wuhan, the average MAE, RMSE, and MAPE errors were reported to be lower than 3% on average. For non-household registration in Wuhan, XGBoost achieved MAE of 26.33, RMSE of 5.13, and MAPE of 0.44 in its best-performing year (2022). The study also identified "out-of-pocket amount," "medical insurance," and "admission department" as the top three predictive factors for LOS.

Limitations and Future Work

The authors acknowledge several limitations:

  • Single-Center Study: The data was collected from a single hospital, which may limit the generalizability of the findings to other healthcare settings.
  • Temporal Changes: Changes in discharge policies, clinical practices, and admission statuses over time, especially post-pandemic, could impact prediction accuracy.
  • Data Bias: Machine learning models can be prone to biases if the training data is not representative of diverse populations, potentially leading to inequitable outcomes.
  • Algorithmic Decision-Making: Over-reliance on ML outputs without clinical judgment could lead to suboptimal care.

Future work suggested includes:

  • Incorporating Text and Image Data: Enhancing LOS prediction by leveraging information from electronic medical records beyond structured data.
  • Deep Learning Models: Exploring more advanced deep learning techniques for prediction.
  • Larger and Diverse Datasets: Expanding the dataset to include multiple hospitals and a wider range of patient demographics and conditions to improve robustness and generalizability.
  • Understanding Regional Heterogeneity: Further investigating the causes of regional differences in patient outcomes and healthcare utilization.

Summary updated

BibTeX
@inproceedings{liu2024application,
  author = {Yang Liu and Renzhao Liang and Chengzhi Zhang},
  title = {{The application of machine learning algorithms for predicting length of stay before and during the COVID-19 pandemic: evidence from Wuhan-area hospitals}},
  booktitle = {Frontiers Digit. Health},
  year = {2024},
  url = {https://openreview.net/forum?id=75Je9AEUzb},
}
Figure