A Comparison of XGBoost and LightGBM for Predicting Length of Hospital Stay Perbandingan XGBoost dan LightGBM untuk Prediksi Lama Rawat Inap di Rumah Sakit

Main Article Content

Syarif Hidayatullah
Fadhilah Qalbi Annisa
Elly Matul Imah

Abstract

Length of Stay (LOS) is a key indicator for assessing hospital service efficiency, particularly under the INA-CBGs reimbursement scheme. Prolonged LOS can lead to cost inefficiencies and bed capacity constraints, especially in referral hospitals with high patient volumes. This study aims to compare the performance of two gradient boosting-based machine learning algorithms, LightGBM and XGBoost, in predicting inpatient LOS using Electronic Medical Records (EMR). Data were sourced from inpatients during 2023-2024, encompassing demographics, diagnoses, and medication consumption. After preprocessing and feature engineering, the final dataset comprised 5,557 patients with 799 features. Both models were trained and evaluated using 5-fold cross-validation with Bayesian Optimization for hyperparameter tuning. Results show that LightGBM achieved the best performance with an RMSE of 2.31, MedAE of 0.85, and R2 of 0.79, while being 4.5 times faster in training than XGBoost. Feature selection analysis confirmed that reducing features from 799 to 137 (threshold 0.001) maintained LightGBM accuracy (R2 = 0.78) while decreasing computational time by 74.9%. SHAP analysis revealed that medication features, particularly injectable antibiotics and intravenous fluids, were the most dominant contributors to LOS prediction. These findings demonstrate that LightGBM offers an optimal balance between predictive accuracy and computational efficiency for supporting clinical planning based on structured EMR data.

Downloads

Download data is not yet available.

Article Details

How to Cite
Hidayatullah, S., Annisa, F. Q., & Imah, E. M. (2026). A Comparison of XGBoost and LightGBM for Predicting Length of Hospital Stay: Perbandingan XGBoost dan LightGBM untuk Prediksi Lama Rawat Inap di Rumah Sakit. Jurnal Riset Aplikasi Ilmu Data Dan Sistem, 1(1), 79–94. Retrieved from https://ejournal.unesa.ac.id/index.php/rapids/article/view/79420
Section
Articles