# Machine learning-based online prediction of nocturnal hypoglycemia in elderly patients with type 2 diabetes

**Authors:** Yuntong Liu, Chenhua Guo, Xinyu Li, Shen Li, Jiajun Huang, Liang Zhao, Yan Zhu, Xuhan Liu, Bing Wang, Rui Lin, Jingshi Wang, Zhengnan Gao, Jing Gao, Yingshu Liu

PMC · DOI: 10.3389/fendo.2025.1685969 · Frontiers in Endocrinology · 2026-01-07

## TL;DR

A machine learning model was developed to predict nighttime low blood sugar in elderly type 2 diabetes patients, using easily accessible clinical data.

## Contribution

A novel ensemble machine learning model (RF-ET-KNN) was developed and validated for predicting nocturnal hypoglycemia in elderly T2D patients.

## Key findings

- The RF-ET-KNN model achieved an AUROC of 0.947 and sensitivity of 0.929 in predicting nocturnal hypoglycemia.
- Daytime lowest blood glucose, fasting blood glucose, and daytime hypoglycemia events were identified as significant risk factors for nocturnal hypoglycemia.
- The model uses 11 clinically accessible features and is available as an online risk calculator.

## Abstract

Nocturnal hypoglycemia (NH) is a common adverse event in elderly patients with type 2 diabetes (T2D). This study aims to develop a clinically applicable model for predicting the risk of NH in elderly patients with T2D.

This retrospective cohort study, conducted from May 2018 to June 2024, analyzed 1,128 elderly T2D patients undergoing continuous glucose monitoring, with an independent validation involving 100 outpatients. Clinical characteristics were collected, and feature engineering was performed to select a manageable set of clinically accessible features. An ensemble model was developed using multiple base models and a stacking approach. The best-performing model was deployed as an online risk calculator.

Of the development set, 288 (25.5%) experienced NH, while 40 (40%) of the independent validation cohort experienced NH. The final ensemble model, “RF-ET-KNN”, combined random forest, Extra Trees, and K-nearest neighbor as base learners, with Extra Trees serving as the meta-learner. It incorporated eleven clinical features and achieved an AUROC of 0.926 and sensitivity of 0.853 on the test set, and an AUROC of 0.947 and sensitivity of 0.929 on the internal validation set. SHAP analysis identified that daytime lowest blood glucose (BG), fasting blood glucose (FBG), and daytime hypoglycemia events were closely related to NH. A user-friendly calculator is available at http://122.51.219.102:8000/.

The “RF-ET-KNN” model, integrating eleven clinically accessible features, effectively predicts NH in elderly T2D patients. Daytime lowest BG, FBG, and daytime hypoglycemia events were significant risk factors.

## Linked entities

- **Diseases:** type 2 diabetes (MONDO:0005148)

## Full-text entities

- **Diseases:** NH (MESH:D007003), T2D (MESH:D003924)
- **Chemicals:** glucose (MESH:D005947), BG (MESH:D001786)
- **Species:** Homo sapiens (human, species) [taxon 9606]

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC12819298/full.md

## Figures

4 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12819298/full.md

## References

41 references — full list in the complete paper: https://tomesphere.com/paper/PMC12819298/full.md

---
Source: https://tomesphere.com/paper/PMC12819298