The Prediction of Hospital Readmission in Diabetic Patients Using Random Forest, XGBoost, and Support Vector Machine with an Explainable AI Approach

Authors

  • Zulfaqar Zul Institut Kesehatan dan Teknologi Al Insyirah
  • Ridho Amanda Putra Universitas Prima
  • Hadnan Hardiansyah Hardiansyah Institut Az Zuhra

DOI:

https://doi.org/10.31004/jestm.v6i3.480

Keywords:

Diabetes mellitus, Machine learning, Random forest, XGboost, SHAP

Abstract

Hospital readmission among patients with diabetes is an indicator of healthcare quality, treatment effectiveness, and hospitalization burden. Early prediction of readmission risk may support targeted interventions and reduce repeated hospital stays. This study developed prediction models using Random Forest, Extreme Gradient Boosting (XGBoost), and Support Vector Machine (SVM), with SHapley Additive exPlanations (SHAP) applied to interpret model predictions. The Diabetes 130-US Hospitals dataset comprised 101,766 medical records containing demographic characteristics, hospital visit history, laboratory results, diagnoses, and medication use. The outcome was defined as unplanned readmission within 30 days of discharge by recoding the original “<30,” “>30,” and “NO” categories. Data were divided into training and test sets at an 80:20 ratio using stratified sampling, preserving the class distribution of 11.16% readmitted and 88.84% not readmitted without resampling. Random Forest and XGBoost were trained on the full training set, whereas SVM used a stratified subsample of 10,000 training records because of computational constraints. All models were evaluated using the same test set. XGBoost achieved the best performance, with a balanced accuracy of 0.632 and ROC-AUC of 0.684. McNemar’s test indicated that its performance differed significantly from SVM but not from Random Forest. SHAP identified payer type, diagnosis categories, age group, prior inpatient history, and Clinical Risk Score as influential predictors. These findings demonstrate the feasibility of combining machine learning and explainable artificial intelligence for clinically interpretable readmission prediction. However, reliance on a single historical public dataset and the absence of external validation limit the model’s readiness for clinical deployment.

References

Breiman, L. (2001). Random forests. Machine Learning, 45(1), 5–32. https://doi.org/10.1023/A:1010933404324

Chen, T., & Guestrin, C. (2016). XGBoost: A scalable tree boosting system. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (pp. 785–794). Association for Computing Machinery. https://doi.org/10.1145/2939672.2939785

Cortes, C., & Vapnik, V. (1995). Support-vector networks. Machine Learning, 20(3), 273–297. https://doi.org/10.1007/BF00994018

Hosmer, D. W., Lemeshow, S., & Sturdivant, R. X. (2013). Applied logistic regression (3rd ed.). John Wiley & Sons. https://doi.org/10.1002/9781118548387

Lundberg, S. M., & Lee, S.-I. (2017). A unified approach to interpreting model predictions. In Advances in Neural Information Processing Systems (Vol. 30, pp. 4765–4774). Curran Associates, Inc.

Strack, B., DeShazo, J. P., Gennaro, S., et al. (2014). Impact of HbA1c measurement on hospital readmission rates: Analysis of 70,000 clinical database patient records. BioMed Research International, 2014, Article 781670. https://doi.org/10.1155/2014/781670

Ribeiro, M. T., Singh, S., & Guestrin, C. (2016). “Why should I trust you?”: Explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (pp. 1135–1144). Association for Computing Machinery. https://doi.org/10.1145/2939672.2939778

Chawla, N. V., Bowyer, K. W., Hall, L. O., & Kegelmeyer, W. P. (2002). SMOTE: Synthetic minority over-sampling technique. Journal of Artificial Intelligence Research, 16, 321–357. https://doi.org/10.1613/jair.953

Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., & Duchesnay, É. (2011). Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12, 2825–2830.

Shang, Y., Jiang, K., Wang, L., Zhang, Z., Zhou, S., Liu, Y., Dong, J., & Wu, H. (2021). The 30-days hospital readmission risk in diabetic patients: Predictive modeling with machine learning classifiers. BMC Medical Informatics and Decision Making, 21, Article 57.

Emi-Johnson, O. G., & Nkrumah, K. J. (2025). Predicting 30-day hospital readmission in patients with diabetes using machine learning on electronic health record data. Cureus, 17(4), Article e82437.

Salim, S. S., & Ibrahim, A. A. (2026). A machine learning approach for predicting 30-day hospital readmission in patients with diabetes. Healthcare, 14(9), Article 1185.

Hu, T.-L., Chao, C.-M., Wu, C.-C., Chien, T.-N., & Li, C. (2024). Machine learning-based predictions of mortality and readmission in type 2 diabetes patients in the ICU. Applied Sciences, 14(18), Article 8443.

Jose, R., Syed, F., Thomas, A., & Toma, M. (2024). Cardiovascular health management in diabetic patients with machine-learning-driven predictions and interventions. Applied Sciences, 14(5), Article 2132.

Wang, L., Wei, C., Chen, Y., Lu, D.-S., Zhang, H.-X., & Yang, M. (2026). Machine learning-based prediction model for 30-day readmission risk in elderly patients with type 2 diabetes mellitus and heart failure: A retrospective cohort study with SHAP interpretability analysis. Frontiers in Cardiovascular Medicine, 12, Article 1673159.

Lundberg, S. M., Erion, G., Chen, H., DeGrave, A., Prutkin, J. M., Nair, B., Katz, R., Himmelfarb, J., Bansal, N., & Lee, S.-I. (2020). From local explanations to global understanding with explainable AI for trees. Nature Machine Intelligence, 2(1), 56–67. https://doi.org/10.1038/s42256-019-0138-9

Genitsaridi, I., Salpea, P., Salim, A., Sajjadi, S. F., Tomic, D., James, S., Thirunavukkarasu, S., et al. (2026). 11th edition of the IDF Diabetes Atlas: global, regional, and national diabetes prevalence estimates for 2024 and projections for 2050. The Lancet Diabetes & Endocrinology, 14(2), 149–156. https://doi.org/10.1016/S2213-8587(25)00299-2

Rubin, D. J. (2015). Hospital readmission of patients with diabetes. Current Diabetes Reports, 15(4), 17. https://doi.org/10.1007/s11892-015-0584-7

Jencks, S. F., Williams, M. V., & Coleman, E. A. (2009). Rehospitalizations among patients in the Medicare fee-for-service program. New England Journal of Medicine, 360(14), 1418–1428. https://doi.org/10.1056/NEJMsa0803563

Downloads

Published

2026-09-19

How to Cite

Zul, Z., Putra, R. A., & Hardiansyah, H. H. (2026). The Prediction of Hospital Readmission in Diabetic Patients Using Random Forest, XGBoost, and Support Vector Machine with an Explainable AI Approach. Journal of Engineering Science and Technology Management (JES-TM), 6(3), 536–546. https://doi.org/10.31004/jestm.v6i3.480