A COMPARISON OF RANDOM FOREST AND XGBOOST PERFORMANCE IN PREDICTING 30-DAY READMISSION OF INPATIENTS USING THE MIMIC-IV DATASET
- Authors
-
-
Satriyo Kristanto
Baptis Hospital Health Sciences College of Kediri, Indonesia -
Yustyzia Priyatmaja Putri
Baptis Hospital Health Sciences College of Kediri, Indonesia
-
- Keywords:
- Machine learning, Patient readmission, Random forest, XGBoost, SHAP
- Abstract
-
Objective: Based on the results of a study using the MIMIC-IV dataset—which consists of 425 patient records after data cleaning—the objective of this study was to build predictive models for 30-day patient readmission using the Random Forest and XGBoost algorithms. Method: The variables used included patient age, gender, length of stay (LOS), admission type, insurance status, marital status, and race. The research stages included data preprocessing, creating a 30-day readmission label, encoding categorical variables, splitting the data into training and test sets at an 80:20 ratio, and evaluating the models using the metrics Accuracy, Precision, Recall, F1-Score, and Area Under the Curve (AUC-ROC). Results: The findings confirm that Random Forest delivered the best performance with an accuracy of 78.82%, precision of 55.00%, recall of 55.00%, an F1-score of 55.00%, and an AUC-ROC of 0.8354. Meanwhile, XGBoost yielded an accuracy of 77.65%, precision of 52.63%, recall of 50.00%, an F1-score of 51.28%, and an AUC-ROC of 0.8012. Analysis of the confusion matrix showed that Random Forest correctly identified 56 non-readmission cases and 11 readmission cases. Additionally, feature importance analysis indicates that length of stay (LOS) is the most influential factor in readmission prediction, followed by patient age and admission type. Novelty: To improve model interpretability, an Explainable Artificial Intelligence (XAI) analysis using SHAP was conducted, confirming the significant contribution of the LOS variable to readmission risk. The results of this study indicate that Random Forest outperforms XGBoost in predicting patient readmissions and has the potential to support clinical decision-making in efforts to prevent hospital readmissions.
- References
-
[1] A. E. W. Johnson, L. Bulgarelli, L. Shen, A. Gayles, A. Shammout, S. Horng, et al., “MIMIC-IV, a freely accessible electronic health record dataset,” Sci. Data, vol. 10, no. 1, Art. no. 1, Jan. 2023.
[2] CMS, “Hospital Readmissions Reduction Program,” 2023. [Online]. Available: https://www.cms.gov/medicare/payment/prospective-payment-systems/acute-inpatient-pps/hospital-readmissions-reduction-program-hrrp.
[3] P. Michailidis, A. Dimitriadou, T. Papadimitriou, and P. Gogas, “Forecasting hospital readmissions with machine learning,” Healthcare, vol. 10, no. 6, Art. no. 981, May 2022.
[4] A. Rajkomar, J. Dean, and I. Kohane, “Machine learning in medicine,” N. Engl. J. Med., vol. 380, no. 14, pp. 1347–1358, Apr. 2019.
[5] P. V. R. Panchangam, A. T., B. U. T., and M. J. Maniaci, “Machine learning-based prediction of readmission risk in cardiovascular and cerebrovascular conditions using patient EMR data,” Healthcare, vol. 12, no. 15, Art. no. 1497, Jul. 2024.
[6] S. Dafrallah and M. A. Akhloufi, “Hospital re-admission prediction using named entity recognition and explainable machine learning,” Diagnostics, vol. 14, no. 19, Art. no. 2151, Sep. 2024.
[7] S. Davis and R. Greiner, “Survival models and longitudinal medical events for hospital readmission forecasting,” BMC Health Serv. Res., vol. 24, no. 1, Art. no. 1394, Nov. 2024.
[8] M. Zhang and T.-T. Kuo, “Early prediction of long hospital stay for intensive care units readmission patients using medication information,” Comput. Biol. Med., vol. 174, Art. no. 108451, May 2024.
[9] C.-Y. Wu, C.-N. Hsu, C. Wang, J.-Y. Chien, C.-C. Wang, and F.-J. Lin, “Predicting outcomes after hospitalisation for COPD exacerbation using machine learning,” ERJ Open Res., vol. 11, no. 3, Art. no. 00651-2024, May 2025.
[10] C. Molnar, Interpretable Machine Learning: A Guide for Making Black Box Models Explainable. Christoph Molnar, 2022.
[11] S. Lundberg and S.-I. Lee, “A unified approach to interpreting model predictions,” Nov. 25, 2017.
[12] C. Bentéjac, A. Csörgő, and G. Martínez-Muñoz, “A comparative analysis of gradient boosting algorithms,” Artif. Intell. Rev., vol. 54, no. 3, pp. 1937–1967, Mar. 2021.
[13] T. Chen and C. Guestrin, “XGBoost: A scalable tree boosting system,” in Proc. 22nd ACM SIGKDD Int. Conf. Knowl. Discovery Data Mining, New York, NY, USA: ACM, 2016, pp. 785–794.
[14] G. Biau and E. Scornet, “A random forest guided tour,” TEST, vol. 25, no. 2, pp. 197–227, Jun. 2016.
[15] L. Breiman, “Random forests,” Mach. Learn., vol. 45, no. 1, pp. 5–32, Oct. 2001.
[16] M. M. Ahsan, S. A. Luna, and Z. Siddique, “Machine-learning-based disease diagnosis: A comprehensive review,” Healthcare, vol. 10, no. 3, Art. no. 541, Mar. 2022.
[17] O. G. Emi-Johnson and K. J. Nkrumah, “Predicting 30-day hospital readmission in patients with diabetes using machine learning on electronic health record data,” Cureus, vol. 17, no. 4, Art. no. e82437, 2025.
[18] E. J. Topol, “High-performance medicine: The convergence of human and artificial intelligence,” Nat. Med., vol. 25, no. 1, pp. 44–56, Jan. 2019.
[19] M. P. Sendak, J. D’Arcy, S. Kashyap, M. Gao, M. Nichols, K. M. Corey, et al., “A path for translation of machine learning products into healthcare delivery,” EMJ Innov., 2020. [Online]. Available: https://api.semanticscholar.org/CorpusID:211837289.
[20] Kementerian Kesehatan Republik Indonesia, Keputusan Menteri Kesehatan Republik Indonesia. Jakarta, Indonesia, 2024. [Online]. Available: https://arissusanto.com/wp-content/uploads/2024/10/KMK-No.-HK.01.07-MENKES-1596-2024-ttg-Standar-Akreditasi-Rumah-Sakit-signed.pdf.
[21] Kementerian Kesehatan Republik Indonesia, Peraturan Menteri Kesehatan Nomor 3 Tahun 2023, 2023. [Online]. Available: https://peraturan.bpk.go.id/Details/275518/permenkes-no-3-tahun-2023.
[22] A. Chiavegatto Filho, A. F. De Moraes Batista, and H. Geremias dos Santos, “Data leakage in health outcomes prediction with machine learning. Comment on ‘Prediction of incident hypertension within the next year: Prospective study using statewide electronic health records and machine learning,’” J. Med. Internet Res., vol. 23, no. 2, Art. no. e10969, 2021. [Online]. Available: https://www.jmir.org/2021/2/e10969.
[23] S. Kaufman, S. Rosset, and C. Perlich, “Leakage in data mining,” in Proc. 17th ACM SIGKDD Int. Conf. Knowl. Discovery Data Mining, New York, NY, USA: ACM, 2011, pp. 556–563.



