Machine learning for predicting emergency department visits in patients with type 2 diabetes: A real-world, multi-institutional study

S Sunyoung Kim H Hyunji Sang J Jaeyu Park S Selin Woo E Eun-Hee Cho C Chong Hwa Kim D Dae Jung Kim C Chang-Won Jeong T Tae Sun Park Y You-Cheol Hwang H Hyunjung Lim Z Zio Kim H Hyejin Kang D Dong Keon Yon S Sang Youl Rhee

Abstract

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.

Article Details

Journal PLoS ONE
Volume / Issue Vol. 21, Issue 7
Published July 09, 2026
Pages e0352342
ISSN 1932-6203
Publisher Public Library of Science

Journal Info

PLoS ONE

Public Library of Science

ISSN: 1932-6203 Open Access Health Sciences

Authors (15)

S

Sunyoung Kim

H

Hyunji Sang

J

Jaeyu Park

S

Selin Woo

E

Eun-Hee Cho

C

Chong Hwa Kim

D

Dae Jung Kim

C

Chang-Won Jeong

T

Tae Sun Park

Y

You-Cheol Hwang

H

Hyunjung Lim

Z

Zio Kim

H

Hyejin Kang

D

Dong Keon Yon

S

Sang Youl Rhee