Admission-time prediction of hospital length of stay in diverticular disease using explainable machine learning models

Acute diverticulitis (AD) is a leading cause of emergency department admissions and hospitalizations worldwide. Accurately predicting hospital length of stay (LOS) at the time of admission is essential for optimizing the utilization of resources, planning discharges and managing patients. The aim of this study was to develop and validate an explainable machine learning framework for predicting LOS at the time of admission in patients with diverticulitis and diverticulosis. A retrospective dataset comprising 148 hospitalized patients was analyzed. Advanced feature engineering techniques were applied, including interaction terms, nonlinear transformations, logarithmic scaling and clinically derived inflammatory indices. Multiple regression-based and machine learning model such as Linear Regression, Ridge Regression, Random Forest, XGBoost and a Voting Regressor ensemble were trained using log-transformed LOS values. Model performance was evaluated using five-fold cross-validation, bootstrap-based stability analysis, calibration assessment, SHAP-based explainability and Kaplan-Meier-based risk stratification. The mean LOS was 2.08 ± 2.5 days. Tree-based ensemble models demonstrated better predictive performance compared to linear models. XGBoost performed best in the full cohort (mean absolute error (MAE) = 0.03; R² = 0.99), while Random Forest and ensemble approaches showed comparable or improved performance in the diverticulitis subgroup with MAE of 0.74 and R² of 0.77. XGBoost showed exceptionally high apparent performance in the full cohort. However, stricter internal validation produced more conservative estimates. Patient-level nested out-of-fold (OOF) evaluation resulted in an R² of approximately 0.57, while bootstrap optimism correction yielded an optimism-corrected R² of 0.8314 and MAE of 0.3512 days. SHAP analysis indicated that Hinchey class and inflammatory characteristics contributed substantially to model predictions. Calibration and residual analyses indicated acceptable agreement between predicted and observed LOS, while prediction intervals provided clinically relevant uncertainty estimates. Subgroup analysis revealed decreased predictive performance and increased variability, reflecting the challenges associated with reduced sample size and heterogeneity. Combining explainable machine learning with clinically informed feature engineering provides a promising framework for estimating LOS at the time of admission for diverticular disease. However, the more conservative nested cross-validation results highlight the need for larger, independent cohorts in order to establish the generalizability and potential utility of the proposed approach.

Authors

Institutions

Publication Details

Journal
Scientific Reports
Published
2026-10-26
DOI
https://doi.org/10.1038/s41598-026-78128-7
Primary Topic
Diverticular Disease and Complications
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Admission-time prediction of hospital length of stay in diverticular disease using explainable machine learning models

Gürkan Güneri, Özcan Emre, Emre Dandıl, Mehmet Emin GÖNÜLLÜ et al.
Scientific Reports
Diverticular Disease and Complications
article

Admission-time prediction of hospital length of stay in diverticular disease using explainable machine learning models

Gürkan Güneri, Özcan Emre, Emre Dandıl, Mehmet Emin GÖNÜLLÜ, Kevser Dilek Andıç, Mücahit Ünal, Kadir Çorbacı, Doğuşcan Kurular
article en

Abstract

Acute diverticulitis (AD) is a leading cause of emergency department admissions and hospitalizations worldwide. Accurately predicting hospital length of stay (LOS) at the time of admission is essential for optimizing the utilization of resources, planning discharges and managing patients. The aim of this study was to develop and validate an explainable machine learning framework for predicting LOS at the time of admission in patients with diverticulitis and diverticulosis. A retrospective dataset comprising 148 hospitalized patients was analyzed. Advanced feature engineering techniques were applied, including interaction terms, nonlinear transformations, logarithmic scaling and clinically derived inflammatory indices. Multiple regression-based and machine learning model such as Linear Regression, Ridge Regression, Random Forest, XGBoost and a Voting Regressor ensemble were trained using log-transformed LOS values. Model performance was evaluated using five-fold cross-validation, bootstrap-based stability analysis, calibration assessment, SHAP-based explainability and Kaplan-Meier-based risk stratification. The mean LOS was 2.08 ± 2.5 days. Tree-based ensemble models demonstrated better predictive performance compared to linear models. XGBoost performed best in the full cohort (mean absolute error (MAE) = 0.03; R² = 0.99), while Random Forest and ensemble approaches showed comparable or improved performance in the diverticulitis subgroup with MAE of 0.74 and R² of 0.77. XGBoost showed exceptionally high apparent performance in the full cohort. However, stricter internal validation produced more conservative estimates. Patient-level nested out-of-fold (OOF) evaluation resulted in an R² of approximately 0.57, while bootstrap optimism correction yielded an optimism-corrected R² of 0.8314 and MAE of 0.3512 days. SHAP analysis indicated that Hinchey class and inflammatory characteristics contributed substantially to model predictions. Calibration and residual analyses indicated acceptable agreement between predicted and observed LOS, while prediction intervals provided clinically relevant uncertainty estimates. Subgroup analysis revealed decreased predictive performance and increased variability, reflecting the challenges associated with reduced sample size and heterogeneity. Combining explainable machine learning with clinically informed feature engineering provides a promising framework for estimating LOS at the time of admission for diverticular disease. However, the more conservative nested cross-validation results highlight the need for larger, independent cohorts in order to establish the generalizability and potential utility of the proposed approach.

Scientific ReportsVol. 16(1)
Bilecik Şeyh Edebali Üniversitesi (TR)
Openalex Percentile: Top 10%
Diverticular Disease and Complications
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