Year : 2026, Volume : 6, Issue : 3

  1. Home
  2. Archive
  3. Year : 2026, Volume : 6, Issue : 3

Machine learning prediction of ınpatient length of stay in hospitalised patients with diabetes

Fatma Hilal Yagin, Emek Guldogan, Cemil Colak

DOI: 10.5455/atjmed.2026.05.049 · Page: 350-60 · 16 Views · 1 Downloads · 0 Citations

Abstract

Aim: This study aimed to identify clinical, demographic, and pharmaceutical predictors of inpatient hospital length of stay (LOS) among diabetic patients using supervised machine learning classifiers, and to evaluate the comparative predictive performance of these models for LOS risk stratification.

Materials and Methods: The University of California, Irvine (UCI) Diabetes 130-US Hospitals dataset (N = 101,763 encounters; 1999–2008) was used as the analytical sample. Following systematic preprocessing—including International Classification of Diseases, Ninth Revision (ICD-9) diagnostic grouping, ordinal age encoding, and medication status encoding—length of stay was operationalised as a three-class outcome: short (1–3 days; 48.3%), medium (4–7 days; 36.6%), and long (8–14 days; 15.0%). Spearman rank correlations and non-parametric group comparisons (Kruskal-Wallis test) were applied to examine univariate associations. Three supervised machine learning classifiers were then evaluated on held-out test data (n = 25,441): Logistic Regression, Decision Tree, and Gradient Boosting.

Results: Spearman rank correlations revealed that polypharmacy (rs = 0.465, p < 0.001) and the number of laboratory procedures (rs = 0.337, p < 0.001) exhibited the strongest associations with LOS. Patient age demonstrated a statistically significant positive association with LOS (rs = 0.120, p < 0.001). Non-parametric group comparisons demonstrated significant variation in LOS across primary diagnosis categories (Kruskal-Wallis H = 1,780.77, p < 0.001) and age groups (H = 1,582.78, p < 0.001). The Gradient Boosting classifier achieved the highest classification accuracy (62.2%) and macro F1-score (0.56), with polypharmacy, laboratory workload, and discharge disposition emerging as the three most influential predictive features.

Conclusion: These findings highlight the utility of ensemble machine learning methods for LOS risk stratification in diabetic inpatients. Polypharmacy, laboratory workload, and discharge disposition were identified as the primary drivers of prolonged hospitalisation, suggesting that targeted monitoring of these factors may support more effective resource allocation strategies in hospital settings.


Keywords : Diabetes mellitus; machine learning; gradient boosting; hospital informatics; predictive modelling; clinical decision support

Full Text (PDF)