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

Institutions

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
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

Predicting length of stay with machine learning using early admission data – findings from the CAPNOR pneumonia cohort

Dagfinn Lunde Markussen, Steffen Hadasch, Christian Ritz, Elling Ulvestad et al.
BMC Medical Informatics and Decision Making
Pneumonia and Respiratory Infections
article

Predicting length of stay with machine learning using early admission data – findings from the CAPNOR pneumonia cohort

Dagfinn Lunde Markussen, Steffen Hadasch, Christian Ritz, Elling Ulvestad, Harleen M. S. Grewal, Galo Adrián Goig, Synne Jenum
article en

Abstract

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.

BMC Medical Informatics and Decision Making
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)
Pneumonia and Respiratory Infections
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon