Machine learning for predicting emergency department visits in patients with type 2 diabetes: A real-world, multi-institutional study - Sunyoung Kim; Hyunji Sang; Jaeyu Park; Selin Woo; Eun-Hee Cho; Chong Hwa Kim; Dae Jung Kim; Chang-Won Jeong; Tae Sun Park; You-Cheol Hwang; Hyunjung Lim; Zio Kim; et al. (PLoS ONE, 2026)
Background Patients with type 2 diabetes mellitus (T2DM) prone to acute diabetic complications are at high risk for emergency department (ED) visits, which often precede hospitalization and mortality. Identifying these high-risk phenotypes before deterioration is critical for preventative care. We developed machine learning (ML) models using large-scale, real-world electronic medical records, including prescription data, to predict the possibility of ED visits in patients with T2DM and support proactive interventions in primary care settings. Methods We analyzed the electronic health record data of five independent institutions, creating a comprehensive dataset of 220,720 patients. The data included dynamic clinical parameters such as vital signs, laboratory results, and prescription histories. The cohort was randomly split into a training set ( n = 176,576) and a test set ( n = 44,144). The primary outcome was the first ED visit. We developed multiple ML models using an automated ML framework and optimized them using hyperparameter tuning of the training set. Model performances were evaluated using the area under the receiver operating characteristic (AUROC) curve, and feature importance was analyzed using SHAP values to ensure interpretability. Results Among the screened population, 49,770 (22.6%) experienced at least one ED visit, distributed proportionally across the training and test datasets. The CatBoost model demonstrated superior predictive performance, achieving an AUROC of 0.87 (95% CI, 0.862–0.871) on the test dataset. The model identified modifiable risk factors as key predictors; Diastolic blood pressure was the most significant variable, followed by serum creatinine and systolic blood pressure. Conclusions This ML-based predictive model can accurately identify high-risk patients with T2DM who are likely to visit the ED based on readily available clinical variables. By enabling healthcare providers to shift from reactive treatment to proactive risk management, it has the potential to reduce the burden of ED visits due to acute complications in T2DM.