Related Experiment Video
Updated: Jun 1, 2026

Implementation of a Real-Time Psychosis Risk Detection and Alerting System Based on Electronic Health Records using CogStack
Published on: May 15, 2020
Electronic health record-derived machine learning model for hypoglycemia risk prediction in type 2 diabetes mellitus
1Department of Endocrinology, The Second Affiliated Hospital of Chongqing, Medical University, Chongqing, 401336, China.
Background:
Hypoglycemia is a serious complication of diabetes. Early recognition of hypoglycemia can improve clinical prognosis, however, traditional diagnostic tools are often limited. Machine learning offers a promising approach for predicting adverse outcomes in diabetic patients.
Objective:
This study aims to develop and validate machine learning-based models to predict the risk of hypoglycemia in type 2 diabetes mellitus (T2DM) patients.
Methods:
A cohort study design was employed. Clinical data were collected from the electronic health record system. The dataset was randomly partitioned into training and validation subsets using a 7:3 ratio. Four machine learning algorithms, logistic regression (LR), Extreme Gradient Boosting (XGBoost), random forest (RF), and support vector machine (SVM) were implemented to develop hypoglycemia risk prediction models. Predictive performance was assessed using sensitivity, specificity, accuracy, precision, F1 score, and the area under the receiver operating characteristic curve (AUC).
Results:
831 T2DM patients were included, the hypoglycemia incidence was 22.0%. In the training cohort, the AUC for the LR, XGBoost, SVM, and RF models were 0.82, 0.86, 0.84, and 0.80, and corresponding AUCs were 0.76, 0.78, 0.72, and 0.75 in the validation cohort. The XGBoost demonstrated the highest overall predictive performance. Feature importance analysis based on the XGBoost model identified creatinine, triglycerides, albumin, HbA1c, C-peptide, aspartate aminotransferase, hemoglobin, and sulfonylurea use as the most influential predictors of hypoglycemia risk.
Conclusions:
The XGBoost model exhibited superior predictive performance for achieving the higher AUC, F1 score, greater accuracy, sensitivity and specificity. This model enables effective identification of T2DM patients who may require intensified monitoring or targeted interventions to prevent hypoglycemic events.
Clinical Trial Number:
Not applicable.
Related Concept Videos
Type II Diabetes Mellitus III: Clinical Manifestations and Diagnosis
Diabetes Mellitus: Type 2 and Gestational
Hypoglycemia
Type II Diabetes I: Introduction
Hyperglycemia
Type II Diabetes II: Pathophysiology