Background: Machine learning carries great promise to improve healthcare delivery. Clinical outcomes that are routinely and objectively measured, and have serious consequences that can be prevented, are ideal targets for prediction and intervention. Hypoglycemia, defined as a blood glucose less than 3.9 mmol/L (70 mg/dL), meets these criteria. The purpose of this study was to predict hypoglycemia using artificial intelligence models in patients hospitalized to general internal medicine (GIM) and cardiovascular surgery (CV) at a tertiary-care teaching hospital in Toronto, Ontario.

Methods: Models were built using routinely-collected clinical data from the hospital’s electronic health record. Models were trained using data from Jan 2013-Apr 2017, tested using data from Apr 2017-Mar 2018, and validated using held-out test data from Apr 2018-Mar 2019. Three models were generated using supervised machine learning: LASSO regression, gradient boosted trees, and a recurrent neural network. Each model included baseline patient data and time-varying data. Natural language processing was used to incorporate text data from physician and nursing notes.

Results: We included 8492 GIM admissions and 8044 CV admissions. The average age of patients was 68 years, 35% were women, the baseline creatinine was 90 μmol/L (1.0mg/dL) and the baseline A1C was 7%. Hypoglycemia occurred in 15% of GIM admissions and 13% of CV admissions. The area under the curve for the model in the held-out validation set was approximately 0.80 on the GIM ward and 0.82 on the CV ward. When the threshold for hypoglycemia was lowered to 2.9 mmol/L (52 mg/dL), similar results were observed. Among the patients at the highest decile of risk, the positive predictive value was approximately 50% and the sensitivity was 99%.

Conclusion: Using natural language processing and machine learning we were able to accurately identify patients at high risk of hypoglycemia in hospital.


M. Fralick: None. D. Dai: None. C. Pou-Prom: None. A.A. Verma: None. M. Mamdani: None.

Readers may use this article as long as the work is properly cited, the use is educational and not for profit, and the work is not altered. More information is available at