Development and validation of an interpretable machine learning model for predicting in-hospital hypoglycemia in adults with type 1 diabetes mellitus: a multicenter retrospective study.
In-hospital hypoglycemia remains a serious and potentially life-threatening complication among adults with type 1 diabetes mellitus (T1DM), yet reliable and interpretable prediction tools for Chinese inpatients are lacking. We aimed to develop and validate an interpretable machine learning model using multicenter inpatient data to predict the risk of in-hospital hypoglycemia in adults with T1DM, and to enhance clinical understanding of key predictors.
This multicenter retrospective cohort study enrolled adult inpatients with T1DM from five tertiary Grade A hospitals in China between January 1, 2019 and September 30, 2025. From the same multicenter cohort, the total dataset was randomly split 7:3 into a development set (n = 1,048) and an independent external validation set (n = 450). Within the development set, we performed 5-fold stratified cross-validation for hyperparameter tuning, and both internal cross-validation and external validation remained fully independent throughout model development. Machine learning models were trained to predict in-hospital hypoglycemia and evaluated for discrimination, calibration, clinical utility, and interpretability.
The study enrolled 1,498 patients, of whom 580 (38.7%) experienced in-hospital hypoglycemia. The random forest model demonstrated superior predictive performance in the external validation cohort, achieving an AUC of 0.831 (95% CI: 0.798-0.873), sensitivity of 0.793, specificity of 0.748, and a Brier score of 0.149. Hemoglobin, potassium, sodium, low-density lipoprotein cholesterol, and age at onset were identified as the top predictors. Hemoglobin, potassium, sodium, and BMI exhibited U-shaped associations with hypoglycemia risk, where both low and high values increased risk. Exploratory analysis of joint biomarker status showed that patients with abnormalities in two or more of these core predictors had a non-significant trend toward higher event rates, while the complexity of their combined effects was better captured by the non-linear model. The model enabled effective risk stratification into four quartiles, and decision curve analysis confirmed its consistent net clinical benefit across relevant probability thresholds.
The interpretable random forest model using routine inpatient data showed strong discrimination, good calibration and useful risk stratification for in-hospital hypoglycemia in Chinese adults with T1DM, which may help identify high-risk patients early and guide targeted preventive interventions in clinical practice.
This multicenter retrospective cohort study enrolled adult inpatients with T1DM from five tertiary Grade A hospitals in China between January 1, 2019 and September 30, 2025. From the same multicenter cohort, the total dataset was randomly split 7:3 into a development set (n = 1,048) and an independent external validation set (n = 450). Within the development set, we performed 5-fold stratified cross-validation for hyperparameter tuning, and both internal cross-validation and external validation remained fully independent throughout model development. Machine learning models were trained to predict in-hospital hypoglycemia and evaluated for discrimination, calibration, clinical utility, and interpretability.
The study enrolled 1,498 patients, of whom 580 (38.7%) experienced in-hospital hypoglycemia. The random forest model demonstrated superior predictive performance in the external validation cohort, achieving an AUC of 0.831 (95% CI: 0.798-0.873), sensitivity of 0.793, specificity of 0.748, and a Brier score of 0.149. Hemoglobin, potassium, sodium, low-density lipoprotein cholesterol, and age at onset were identified as the top predictors. Hemoglobin, potassium, sodium, and BMI exhibited U-shaped associations with hypoglycemia risk, where both low and high values increased risk. Exploratory analysis of joint biomarker status showed that patients with abnormalities in two or more of these core predictors had a non-significant trend toward higher event rates, while the complexity of their combined effects was better captured by the non-linear model. The model enabled effective risk stratification into four quartiles, and decision curve analysis confirmed its consistent net clinical benefit across relevant probability thresholds.
The interpretable random forest model using routine inpatient data showed strong discrimination, good calibration and useful risk stratification for in-hospital hypoglycemia in Chinese adults with T1DM, which may help identify high-risk patients early and guide targeted preventive interventions in clinical practice.
Authors
Zhang Zhang, Saad Saad, Zhou Zhou, Baakile Baakile, Fu Fu, Li Li, Han Han, Tang Tang, Xuan Xuan, He He, Li Li, Zhao Zhao, Zhu Zhu, Zou Zou, Zhu Zhu
View on Pubmed