Submitted:
18 July 2025
Posted:
18 July 2025
You are already at the latest version
Abstract
Keywords:
1. Introduction
2. Materials and Methods
2.1. Data Source
2.2. Feature Engineering and Preprocessing
- Categorical weather conditions were grouped into five broader categories—Clear, Clouds, Rain, Thunderstorm, and Others—based on their semantic similarity to simplify downstream modeling. Specifically, 'Clouds' and 'Mist' were grouped under Clouds; 'Rain' and 'Drizzle' under Rain; 'Thunderstorm' remained as Thunderstorm; and 'Fog,' 'Haze,' 'Snow,' and 'Smoke' were combined under Others.
- To improve data quality and ensure consistency, specific steps were taken to address missing values and remove unrealistic records. For missing values in the Emergency Severity Index (ESI) field—approximately 2% of the dataset—a value of 3 was assigned, as ESI level 3 accounted for nearly 60% of all recorded entries. Visits with waiting times exceeding 9 hours were excluded, representing 2.1% of the data, since 90% of these cases were extreme outliers with durations spanning several months. Additionally, 51 visits were removed where patients remained in the treatment room for more than seven months with identical treatment-leaving timestamps, indicating likely system logging errors. Finally, 74 visits with recorded boarding times longer than 300 hours were excluded, 70 of which had identical checkout timestamps and were also likely caused by data entry or logging issues.
- Lagged and rolling features were computed using a custom function that systematically transformed each selected variable by generating lagged versions and rolling averages. For each variable, lag features were created by shifting the original values backward by 1 to N hours, producing a series of lagged inputs corresponding to different historical time steps. This enables the model to learn from recent historical values. To capture local trends and smooth out noise, rolling mean features were calculated using a centered moving average over a specified window size.
- Given the unusual operational conditions during the early stages of the COVID-19 pandemic, data from April 2020 to July 2020 were excluded, as boarding patterns during this period did not reflect routine processes. As shown in Appendix 1, the monthly average boarding counts and times were notably lower than in other years, likely due to the uncertainty and disruption experienced by individuals and healthcare institutions at that time.
| Feature | Date Range, Average ± Standard Deviation (Range) for Numerical Features, % for Categorical Features, and Event Counts |
| Date Range Year Month Day of Month Day of Week Hour |
5 years 12 Months Days 1-31 7 Days 24 Hours |
| Boarding Count (Target Variable) | 28.7± 11.2 (0 – 73) |
| Boarding Count by ESI Levels ESI levels 1&2 ESI level 3 ESI levels 4&5 |
17.2 ± 7.5 (0 – 52) 11.4 ± 5.5 (0 – 37) 0.1 ± 0.4 (0 – 5) |
| Average Boarding Time | 621 ± 295.8 (0 – 2446) (minutes) |
| Waiting Count | 18 ± 10 (0 – 65) |
| Waiting Count by ESI Levels ESI levels 1&2 ESI level 3 ESI levels 4&5 |
4.7 ± 3.9 (0 – 24) 10.6 ± 6.7 (0 – 46) 2.5 ± 2.2 (0 – 18) |
| Average Waiting Time | 86.7 ± 62.9 (0 – 425) (minutes) |
| Treatment Count | 53.9 ± 11.7 (5 – 98) |
| Average Treatment Time | 502.8 ± 196 (71 – 1643) (minutes) |
| Extreme Case Indicator | 6361 rows |
| Hospital Census | 788 ± 75 (421 – 1017) |
| Temperature | 62.84 ± 15.55 (8.3 – 100) °F |
| Weather Status Clouds Clear Rain Thunderstorm Others |
60.1% 22.9% 15.45% 1.22% 0.4% |
| Football Game 1 | 54 Games |
| Football Game 2 | 49 Games |
| Federal Holidays | 46 Days |
2.3. Dataset Construction
2.4. Model Architecture and Training
2.5. Model Evaluation
- Mean Absolute Error (MAE): Measures the average size of the errors.
- Mean Squared Error (MSE): Gives more weight to larger errors.
- Root Mean Squared Error (RMSE): The square root of MSE, in the same unit as the target.
- R² Score: Shows how well the predictions match the actual values.
3. Results

| Data Sources and Scaling | Features |
Lags and Rolling Mean* |
DS1 | DS2 | DS3 | DS4 | DS5 |
| ED Tracking | Boarding Count (Target) | Lags (W=12) | X | X | X | X | |
| Lags (W=24) | X | ||||||
| Rolling Mean (W=4) | X | X | |||||
| Average Boarding Time | No Lags | X | X | X | |||
| Lags (W=12) | X | ||||||
| Treatment Count | No Lags | X | X | X | |||
| Lags (W=12) | X | ||||||
| Waiting Count | No Lags | X | X | X | |||
| Lags (W=12) | X | ||||||
| Boarding Count by ESI Levels | X | X | |||||
| Waiting Count by ESI Levels | X | X | |||||
| Average Treatment Time | X | X | X | X | |||
| Average Waiting Time | X | X | X | X | |||
| Extreme Case Indicator | X | X | X | X | |||
| Year, Month, Day of the Month, Day of the Week, Hour | X | X | X | X | X | ||
| Inpatient | Hospital Census | No Lags | X | X | X | ||
| Lags (W=12) | X | ||||||
| Weather | Weather Status (5 Categories) | X | X | X | X | ||
| Temperature | X | X | X | ||||
| Holiday | Federal Holiday | X | X | X | |||
| Events | Football Game 1 | X | X | X | |||
| Football Game 2 | X | X | X |
3.1. Extreme Case Analysis
| Dataset |
Mean + 1σ Extreme (≥ 40) |
Mean + 2σ Very Extreme (≥ 51) |
Mean + 3σ Higly Extreme (≥ 62) |
| MAE / RMSE | MAE / RMSE | MAE / RMSE | |
| Dataset1 | 4.85 / 6.01 | 6.92 / 7.95 | 11.70 / 12.40 |
| Dataset2 | 4.34 / 5.45 | 5.79 / 6.89 | 10.03 / 10.95 |
| Dataset3 | 4.25 / 5.35 | 5.31 / 6.44 | 8.88 / 9.95 |
| Dataset4 | 4.61 / 5.73 | 6.60 / 7.59 | 11.46 / 12.05 |
| Dataset5 | 4.82 / 5.97 | 6.71 / 7.76 | 11.26 / 12.14 |
3.2. Model Explainability

4. Discussion
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
Abbreviations
Appendix A
Appendix A.1

Appendix B
Appendix B.1

References
- Y. Huang, S. S. Ortiz, B. H. Rowe, and R. J. Rosychuk, "Emergency department crowding negatively influences outcomes for adults presenting with asthma: a population-based retrospective cohort study," BMC Emergency Medicine, vol. 22, no. 1, p. 209, 2022.
- R. Xie, F. Timmins, M. Zhang, J. Zhao, and Y. Hou, "Emergency Department Crowding as Contributing Factor Related to Patient-Initiated Violence Against Nurses—A Literature Review," Journal of Advanced Nursing.
- A. Alishahi Tabriz, S. A. Birken, C. M. Shea, B. J. Fried, and P. Viccellio, "What is full capacity protocol, and how is it implemented successfully?," Implementation Science, vol. 14, pp. 1-13, 2019.
- M. H. Mehrolhassani, A. Behzadi, and E. Asadipour, "Key performance indicators in emergency department simulation: a scoping review," Scandinavian Journal of Trauma, Resuscitation and Emergency Medicine, vol. 33, no. 1, p. 15, 2025.
- H. Ouyang, J. Wang, Z. Sun, and E. Lang, "The impact of emergency department crowding on admission decisions and patient outcomes," The American journal of emergency medicine, vol. 51, pp. 163-168, 2022.
- G. Savioli et al., "Emergency department overcrowding: understanding the factors to find corresponding solutions," Journal of personalized medicine, vol. 12, no. 2, p. 279, 2022.
- E. Rabin et al., "Solutions to emergency department ‘boarding’and crowding are underused and may need to be legislated," Health Affairs, vol. 31, no. 8, pp. 1757-1766, 2012.
- C. M. Smalley et al., "The impact of hospital boarding on the emergency department waiting room," JACEP Open, vol. 1, no. 5, pp. 1052-1059, 2020.
- H. Su, L. Meng, R. Sangal, and E. J. Pinker, "Emergency Department Boarding: Quantifying the Impact of ED Boarding on Patient Outcomes and Downstream Hospital Operations," Available at SSRN 4693153, 2024.
- L. Salehi et al., "Emergency department boarding: a descriptive analysis and measurement of impact on outcomes," Canadian Journal of Emergency Medicine, vol. 20, no. 6, pp. 929-937, 2018.
- J. W. Joseph et al., "Boarding Duration in the Emergency Department and Inpatient Delirium and Severe Agitation," JAMA Network Open, vol. 7, no. 6, pp. e2416343-e2416343, 2024.
- M. Y. Yiadom et al., "Managing and measuring emergency department care: results of the fourth emergency department benchmarking definitions summit," Academic Emergency Medicine, vol. 27, no. 7, pp. 600-611, 2020.
- T. Boulain, A. Malet, and O. Maitre, "Association between long boarding time in the emergency department and hospital mortality: a single-center propensity score-based analysis," Internal and emergency medicine, vol. 15, no. 3, pp. 479-489, 2020.
- D. E. Loke, K. A. Green, E. G. Wessling, E. T. Stulpin, and A. L. Fant, "Clinicians’ insights on emergency department boarding: an explanatory mixed methods study evaluating patient care and clinician well-being," The Joint Commission Journal on Quality and Patient Safety, vol. 49, no. 12, pp. 663-670, 2023.
- L. Cheng, M. Tapia, K. Menzel, M. Page, and W. Ellis, "Predicting need for hospital beds to reduce emergency department boarding," The Permanente Journal, vol. 26, no. 4, p. 14, 2022.
- N. R. Hoot, R. C. Banuelos, Y. Chathampally, D. J. Robinson, B. W. Voronin, and K. A. Chambers, "Does crowding influence emergency department treatment time and disposition?," JACEP Open, vol. 2, no. 1, p. e12324, 2021.
- E. O. Suley, "A HYBRID SYSTEMS MODEL FOR EMERGENCY DEPARTMENT BOARDING MANAGEMENT," 2022.
- E. Kim, K. S. Han, T. Cheong, S. W. Lee, J. Eun, and S. J. Kim, "Analysis on benefits and costs of machine learning-based early hospitalization prediction," Ieee Access, vol. 10, pp. 32479-32493, 2022.
- S.-Y. Lee, R. B. Chinnam, E. Dalkiran, S. Krupp, and M. Nauss, "Prediction of emergency department patient disposition decision for proactive resource allocation for admission," Health care management science, vol. 23, pp. 339-359, 2020.
- T. Akiba, S. Sano, T. Yanase, T. Ohta, and M. Koyama, "Optuna: A next-generation hyperparameter optimization framework," in Proceedings of the 25th ACM SIGKDD international conference on knowledge discovery & data mining, 2019, pp. 2623-2631.
- I. Oguiza. "TSTPlus." Github. https://timeseriesai.github.io/tsai/models.tstplus.html (accessed.
- I. Oguiza. "TSiTPlus." Github. https://timeseriesai.github.io/tsai/models.tsitplus.html (accessed 2025).
- I. Oguiza. "ResNetPlus." Github. https://timeseriesai.github.io/tsai/models.resnetplus.html (accessed 2025).
- O. Vural, B. Ozaydin, K. Y. Aram, J. Booth, B. F. Lindsey, and A. Ahmed, "An Artificial Intelligence-Based Framework for Predicting Emergency Department Overcrowding: Development and Evaluation Study," arXiv preprint arXiv:2504.18578, 2025.
- "History Bulk." OpenWeather. https://openweathermap.org/history-bulk (accessed 2025).
- "Federal Holidays." United States Office of Personnel Management. https://www.opm.gov/policy-data-oversight/pay-leave/federal-holidays/ (accessed 2025).
- "Football Schedule." Alabama Athletics - Official Athletics Website. https://rolltide.com/sports/football/schedule (accessed 2025).
- "Football Schedule " Auburn Tigers - Official Athletics Website. https://auburntigers.com/sports/football/schedule (accessed 2025).
- I. Oguiza. "tsai - A state-of-the-art deep learning library for time series and sequential data." Github. https://github.com/timeseriesAI/tsai (accessed 2025).
- A. Paszke, "Pytorch: An imperative style, high-performance deep learning library," arXiv preprint arXiv:1912.01703, 2019.
- J.Howard and S. Gugger, "Fastai: a layered API for deep learning," Information, vol. 11, no. 2, p. 108, 2020.
- G. Zerveas, S. Jayaraman, D. Patel, A. Bhamidipaty, and C. Eickhoff, "A transformer-based framework for multivariate time series representation learning," in Proceedings of the 27th ACM SIGKDD conference on knowledge discovery & data mining, 2021, pp. 2114-2124.
- A. Dosovitskiy et al., "An image is worth 16x16 words: Transformers for image recognition at scale," arXiv preprint arXiv:2010.11929, 2020.
- Bergstra, R. Bardenet, Y. Bengio, and B. Kégl, "Algorithms for hyper-parameter optimization," Advances in neural information processing systems, vol. 24, 2011.
- N. Hansen and A. Ostermeier, "Completely derandomized self-adaptation in evolution strategies," Evolutionary computation, vol. 9, no. 2, pp. 159-195, 2001.
- D. P. Kingma, "Adam: A method for stochastic optimization," arXiv preprint arXiv:1412.6980, 2014.
- L. Bottou, "Stochastic gradient descent tricks," in Neural networks: tricks of the trade: second edition: Springer, 2012, pp. 421-436.
- Y. You et al., "Large batch optimization for deep learning: Training bert in 76 minutes," arXiv preprint arXiv:1904.00962, 2019.

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).