Machine-learning Prediction of Hypo- and Hyperglycemia from Electronic Health Records: Algorithm Development and Validation.

Witte, Harald; Nakas, Christos Theodoros; Bally, Lia; Leichtle, Alexander Benedikt (2022). Machine-learning Prediction of Hypo- and Hyperglycemia from Electronic Health Records: Algorithm Development and Validation. JMIR formative research, 6(7), e36176. JMIR Publications 10.2196/36176

[img] Text
preprint-36176-accepted.pdf - Submitted Version
Restricted to registered users only
Available under License Publisher holds Copyright.

Download (2MB) | Request a copy


The increasing need for blood glucose (BG) management in hospitalized patients poses high demands on clinical staff and health care systems alike. Acute decompensations of BG levels (hypo- and hyperglycemia) adversely affect patient outcomes and safety.


Acute BG decompensations pose a frequent and significant risk for inpatients. Ideally, proactive measures are taken before BG levels derail. We have generated a broadly applicable multiclass classification model for predicting decompensation events from patients' electronic health records to indicate where adjustments of patient monitoring and/or therapeutic interventions are required.


A retrospective cohort study was conducted of patients hospitalized at a tertiary hospital in Bern, Switzerland. Using patient details and routine data from electronic health records (EHRs), a multiclass prediction model for BG decompensation events (< 3.9 mmol/L (hypoglycemia), or > 10, > 13.9, or > 16.7 mmol/L (representing different degrees of hyperglycemia)) was generated, based on a second-level ensemble of gradient-boosted binary trees.


63'579 hospital admissions of 33'212 patients were included in this study. The multiclass prediction model reached a specificity of 93.7%, 98.9%, and 93.9% and a sensitivity of 67.1%, 59.0%, and 63.6%, for the main categories of interest. i.e., non-decompensated cases, hypo- or hyperglycemia, respectively. The median prediction horizon was seven and four hours for hypo- and hyperglycemia, respectively.


EHRs hold the potential to reliably predict all kinds of BG decompensations. Readily available patient details and routine laboratory data can support the decisions for proactive interventions and thus help to reduce the detrimental health effects of hypo- and hyperglycemia.


Item Type:

Journal Article (Original Article)


04 Faculty of Medicine > Department of Haematology, Oncology, Infectious Diseases, Laboratory Medicine and Hospital Pharmacy (DOLS) > Institute of Clinical Chemistry
04 Faculty of Medicine > Department of Gynaecology, Paediatrics and Endocrinology (DFKE) > Clinic of Endocrinology, Diabetology and Clinical Nutrition

UniBE Contributor:

Witte, Harald, Nakas, Christos T., Bally, Lia Claudia, Leichtle, Alexander Benedikt (B)


600 Technology > 610 Medicine & health




JMIR Publications




Pubmed Import

Date Deposited:

09 May 2022 08:28

Last Modified:

02 Mar 2023 23:36

Publisher DOI:


PubMed ID:





Actions (login required)

Edit item Edit item
Provide Feedback