From raw data to actionable insights: preprocessing real-world data for machine learning in diabetes care
Authors:
Open Access
- 25 February 2026
- journal article
- research article
- Published by Frontiers Media SA in Frontiers in Digital Health
- Vol. 8, 1685842
Abstract
Background: Machine Learning (ML) applied to healthcare Real World Data (RWD) may improve patient management. RWD, however, requires extensive preprocessing to make it ML-ready. Our aim was to explore the impact of preprocessing on ML models applied to RWD from 20 years of type 2 diabetes patients visits. Methods: Our cohort consisted of patients with at least two glycated hemoglobin (HbA1c) measurements three years apart. We set up three different experimental settings consisting of different data preprocessing pipelines. Logistic Regression (LR), XGBoost and a Decision Tree Classifier (DTC) were then applied and tuned to optimize precision. Results: The final dataset comprised 12 variables from 1,651 patients treated between 2003 and 2023. 921 (56%) patients had a HbA1c decrease at three years. This group had a higher baseline HbA1c, higher BMI and shorter first visit gap from the date of diagnosis ( p < 0.0001). Precision scores for LR, XGBoost did not vary across different experimental conditions while DTC benefitted from missing data imputation. Shapley Additive Explanations confirmed the Exploratory Data Analysis findings, with worse baseline values being predictors of HbA1c decrease at three years. Conclusions: ML models' performance and their explanation did not vary substantially across experimental conditions, with worse baseline values being predictors of HbA1c decrease at three years. Insights such as this, extracted by ML application to RWD, enable clinical discussion and may foster improvements in patient management.Keywords
Funding Information
- Ministero dell'Università e della Ricerca
This publication has 29 references indexed in Scilit:
- Moving Toward Implementation of Responsible Artificial Intelligence in Health CareJAMA, 2025
- Launching the Trustworthy and Responsible AI Network (TRAIN)JAMA, 2025
- Exploring machine learning tools in a retrospective case-study of patients with metastatic non-small cell lung cancer treated with first-line immunotherapy: A feasibility single-centre experienceLung Cancer, 2024
- 297 Identifying Opportunities and Challenges for Translational Informatics Approaches to Real-World Data: A Diabetes Case StudyJournal of Clinical and Translational Science, 2023
- A prediction model to assess the risk of egfr loss in patients with type 2 diabetes and preserved kidney function: The amd annals initiativeDiabetes Research and Clinical Practice, 2022
- Strengthening evidence-based medicine with real-world evidenceThe Lancet Healthy Longevity, 2022
- Prediction of complications of type 2 Diabetes: A Machine learning approachDiabetes Research and Clinical Practice, 2022
- The need to separate the wheat from the chaff in medical informaticsInternational Journal of Medical Informatics, 2021
- Artificial Intelligence in Health CareJAMA, 2020
- Comparison of three data mining models for predicting diabetes or prediabetes by risk factorsThe Kaohsiung Journal of Medical Sciences, 2012