Skip to main content

Research Repository

Advanced Search

Improving Current Glycated Hemoglobin Prediction in Adults: Use of Machine Learning Algorithms with Electronic Health Records

Alhassan, Zakhriya; Watson, Matthew; Budgen, David; Alshammari, Riyad; Alessa, Ali; Al Moubayed, Noura

Improving Current Glycated Hemoglobin Prediction in Adults: Use of Machine Learning Algorithms with Electronic Health Records Thumbnail


Zakhriya Alhassan

Profile Image

Matthew Watson
Postdoctoral Research Associate

Riyad Alshammari

Ali Alessa


Background: Predicting the risk of glycated hemoglobin (HbA1c) elevation can help identify patients with the potential for developing serious chronic health problems such as diabetes. Early preventive interventions based upon advanced predictive models using electronic health records (EHR) data for identifying such patients can ultimately help provide better health outcomes. Objective: Our study investigates the performance of predictive models to forecast HbA1c elevation levels by employing several machine learning models. We also investigate utilizing the patient's EHR longitudinal data in the performance of the predictive models. Explainable methods have been employed to interpret the decisions made by the blackbox models. Methods: This study employed Multiple Logistic Regression, Random Forest, Support Vector Machine and Logistic Regression models, as well as a deep learning model (Multi-layer perceptron) to classify patients with normal (<5.7%) and elevated (≥5.7%) levels of HbA1c. We also integrated current visit data with historical (longitudinal) data from previous visits. Explainable machine learning methods were used to interrogate the models and provide an understanding of the reasons behind the decisions made by the models. All models were trained and tested using a large dataset from Saudi Arabia with 18,844 unique patient records. Results: The machine learning models achieved promising results for predicting current HbA1c elevation risk. When employed with longitudinal data, the machine learning models outperformed the Multiple Logistic Regression model employed in the comparative study. The multi-layer perceptron model achieved an accuracy of 83.22% for the AUC-ROC when used with historical data. All models showed close level of agreement on the contribution of random blood sugar and age variables with and without longitudinal data. Conclusions: This study shows that machine learning models can provide promising results for the task of predicting current HbA1c levels (≥5.7% or less). Utilizing the patient's longitudinal data improved the performance and affected the relative importance for the predictors used. The models showed results that are consistent with comparable studies.


Alhassan, Z., Watson, M., Budgen, D., Alshammari, R., Alessa, A., & Al Moubayed, N. (2021). Improving Current Glycated Hemoglobin Prediction in Adults: Use of Machine Learning Algorithms with Electronic Health Records. JMIR Medical Informatics, 9(5), Article e25237.

Journal Article Type Article
Acceptance Date Apr 22, 2021
Online Publication Date Apr 22, 2021
Publication Date 2021-05
Deposit Date Apr 28, 2021
Publicly Available Date Apr 28, 2021
Journal JMIR Medical Informatics
Publisher JMIR Publications
Peer Reviewed Peer Reviewed
Volume 9
Issue 5
Article Number e25237


Accepted Journal Article (743 Kb)

Publisher Licence URL

Copyright Statement
© Zakhriya Alhassan, Matthew Watson, David Budgen, Riyad Alshammari, Ali Alessa, Noura Al Moubayed. Originally published
in JMIR Medical Informatics (, 24.05.2021. This is an open-access article distributed under the terms
of the Creative Commons Attribution License (, which permits unrestricted use,
distribution, and reproduction in any medium, provided the original work, first published in JMIR Medical Informatics, is properly
cited. The complete bibliographic information, a link to the original publication on, as well as this
copyright and license information must be included.

You might also like

Downloadable Citations