Predicting length of stay with machine learning using early admission data – findings from the CAPNOR pneumonia cohort
Background Hospital length of stay (LOS) is an important determinant of healthcare resource utilization among patients admitted with suspected community-acquired pneumonia (CAP). Early prediction of LOS may support patient management, discharge planning, and hospital resource allocation. This study evaluated the performance of machine learning (ML) methods for predicting LOS using only data available shortly after hospital presentation. Methods Data from 738 hospitalizations for suspected CAP were obtained from the CAPNOR cohort. A total of 111 predictors available within 180 min of emergency department presentation were considered. Several ML approaches were evaluated, including linear regression, regularized regression models, k-nearest neighbors, random forest, neural network, and extreme gradient boosting (XGBoost). In addition, baseline predictions based on a Pneumonia Severity Index score were evaluated and compared to the ML methods. Model performance was assessed using forward validation, where models were trained on earlier admissions and tested on subsequent admissions to reflect the intended clinical use of the model. Discrimination was evaluated using the area under the receiver operating characteristic curve (AUC), and operational performance was assessed at LOS thresholds of 3, 5, and 10 days. Results LOS was right-skewed, with a median of 3.1 days and a mean of 4.6 days. Across the evaluatedthresholds, several machine-learning approaches and regularized regression models achievedsimilar discrimination in the test sets, with AUC values ranging from 0.61 to 0.73 across modelsand thresholds. The Pneumonia severity index (PSI) showed discrimination comparable to that ofthe best-performing machine-learning models, and pairwise bootstrap comparisons of AUC valuesprovided little evidence for clear superiority of any single modelling approach. For extremegradient boosting, SHAP analysis identified C-reactive protein, cardiac troponin, supplementaloxygen requirement, triage level, age, and pulse rate as among the most influential predictors. Conclusions Early-admission data provided moderate predictive performance for hospital lengthof stay under a temporally realistic validation framework designed to minimize informationleakage. Differences between PSI and the best-performing machine-learning approaches weregenerally small, suggesting that meaningful LOS prediction can be achieved using eitherestablished clinical scores or more complex prediction models. Clinical trial number ClinicalTrials.gov, NCT04660084, starting date: 25 September 2020.
Authors
- Dagfinn Lunde Markussen (ORCID: https://orcid.org/0000-0003-3504-8859)
- Steffen Hadasch
- Christian Ritz (ORCID: https://orcid.org/0000-0002-5095-0624)
- Elling Ulvestad (ORCID: https://orcid.org/0000-0001-5901-8422)
- Harleen M. S. Grewal (ORCID: https://orcid.org/0000-0002-3380-1117)
- Galo Adrián Goig (ORCID: https://orcid.org/0000-0002-4136-6610)
- Synne Jenum (ORCID: https://orcid.org/0000-0001-8187-775X)
Institutions
- University of Southern Denmark (DK)
- Haukeland University Hospital (NO)
- Fundación para el Fomento de la Investigación Sanitaria y Biomédica de la Comunitat Valenciana (ES)
- University of Bergen (NO)
Publication Details
- Journal
- BMC Medical Informatics and Decision Making
- Published
- 2026-12-02
- DOI
- https://doi.org/10.1186/s12911-026-04013-y
- Primary Topic
- Pneumonia and Respiratory Infections
- Type
- article
- Field-Weighted Citation Impact
- 0.00