Machine Learning Prediction of Multidimensional Treatment Response in Type 2 Diabetes: An Internally Validated Observational Study
Keywords:
Type 2 diabetes Machine learning Treatment response Internal validation AlbuminuriaAbstract:
Background: Individual treatment responses in type 2 diabetes vary across glycaemic, weight and albuminuric outcomes. We compared prediction using an expanded clinical gradient-boosting model with a simple linear benchmark under recorded treatment.
Methods: This retrospective single-centre study included 559 participants across five regimens after excluding tirzepatide. Outcomes were nominal 12-month reductions in glycated haemoglobin (HbA1c), relative weight and log1p albuminuria. A baseline-outcome-plus-regimen linear benchmark was compared with clinical linear regression and gradient boosting using identical expanded predictors. Five outer and three inner grouped cross-validation partitions kept matching baseline signatures together. Exploratory analyses assessed exclusion of dapagliflozin, permutation importance, clinical rules and observed-response clustering. The emphasis on HbA1c followed preliminary analyses.
Results: Gradient boosting reduced HbA1c mean absolute error from 0.307 to 0.276 percentage points: a 10.2% improvement (95% confidence interval 4.4–15.3), with out-of-fold coefficient of determination (R²) 0.576. Albuminuria prediction improved by 13.5% (8.4–18.6), with R² 0.214. Weight prediction improved by 3.9% (−1.2 to 8.3), with R² 0.122. Glycaemic and albuminuric gains persisted without dapagliflozin. Baseline HbA1c, renal features and adiposity contributed consistently to glycaemic prediction. Clinical rules did not clearly improve performance. Two internally stable observed-response clusters did not establish validated baseline phenotypes.
Conclusions: The expanded clinical gradient-boosting model improved internally validated response prediction relative to the specified simple linear benchmark, most clearly for HbA1c. This comparison changes both predictors and algorithm and does not isolate the contribution of additional clinical variables. Clinical usefulness, stable responder phenotypes and optimal treatment selection remain unproven. External validation is required.
1. Davies MJ, Aroda VR, Collins BS, et al. Management of Hyperglycemia in Type 2 Diabetes, 2022. A Consensus Report by the American Diabetes Association (ADA) and the European Association for the Study of Diabetes (EASD). Diabetes Care. 2022;45:2753–2786. doi:10.2337/dci22-0034.
2. Labate AM, Cimino E, Giacomelli L, Ettori S, Oladeji OA, Agosti B. Artificial Intelligence in Non-Insulin-Treated Type 2 Diabetes: From Reactive Management to Anticipatory Care. Endocrines. 2026;7(3):40. doi:10.3390/endocrines7030040.
3. Sorli C, Harashima SI, Tsoukas GM, et al. Efficacy and safety of once-weekly semaglutide monotherapy versus placebo in patients with type 2 diabetes (SUSTAIN 1): a double-blind, randomised, placebo-controlled, parallel-group, multinational, multicentre phase 3a trial. Lancet Diabetes Endocrinol. 2017;5:251–260. doi:10.1016/S2213-8587(17)30013-X.
4. Aroda VR, Rosenstock J, Terauchi Y, et al. PIONEER 1: Randomized Clinical Trial of the Efficacy and Safety of Oral Semaglutide Monotherapy in Comparison With Placebo in Patients With Type 2 Diabetes. Diabetes Care. 2019;42:1724–1732. doi:10.2337/dc19-0749.
5. Pratley RE, Aroda VR, Lingvay I, et al. Semaglutide versus dulaglutide once weekly in patients with type 2 diabetes (SUSTAIN 7): a randomised, open-label, phase 3b trial. Lancet Diabetes Endocrinol. 2018;6:275–286. doi:10.1016/S2213-8587(18)30024-X.
6. Zinman B, Wanner C, Lachin JM, et al. Empagliflozin, Cardiovascular Outcomes, and Mortality in Type 2 Diabetes. N Engl J Med. 2015;373:2117–2128. doi:10.1056/NEJMoa1504720.
7. Heerspink HJL, Stefánsson BV, Correa-Rotter R, et al. Dapagliflozin in Patients with Chronic Kidney Disease. N Engl J Med. 2020;383:1436–1446. doi:10.1056/NEJMoa2024816.
8. The EMPA-KIDNEY Collaborative Group. Empagliflozin in Patients with Chronic Kidney Disease. N Engl J Med. 2023;388:117–127. doi:10.1056/NEJMoa2204233.
9. Perkovic V, Tuttle KR, Rossing P, et al. Effects of Semaglutide on Chronic Kidney Disease in Patients with Type 2 Diabetes. N Engl J Med. 2024;391:109–121. doi:10.1056/NEJMoa2403347.
10. Ahlqvist E, Storm P, Käräjämäki A, et al. Novel subgroups of adult-onset diabetes and their association with outcomes: a data-driven cluster analysis of six variables. Lancet Diabetes Endocrinol. 2018;6:361–369. doi:10.1016/S2213-8587(18)30051-2.
11. Dennis JM, Shields BM, Henley WE, Jones AG, Hattersley AT. Disease progression and treatment response in data-driven subgroups of type 2 diabetes compared with models based on simple clinical features: an analysis using clinical trial data. Lancet Diabetes Endocrinol. 2019;7:442–451. doi:10.1016/S2213-8587(19)30087-7.
12. Shields BM, Dennis JM, Angwin CD, et al. Patient stratification for determining optimal second-line and third-line therapy for type 2 diabetes: the TriMaster study. Nat Med. 2023;29:376–383. doi:10.1038/s41591-022-02120-7.
13. Dennis JM, Young KG, McGovern AP, et al. Development of a treatment selection algorithm for SGLT2 and DPP-4 inhibitor therapies in people with type 2 diabetes: a retrospective cohort study. Lancet Digit Health. 2022;4:e873–e883. doi:10.1016/S2589-7500(22)00174-1.
14. Jones AG, McDonald TJ, Shields BM, et al. Markers of β-Cell Failure Predict Poor Glycemic Response to GLP-1 Receptor Agonist Therapy in Type 2 Diabetes. Diabetes Care. 2016;39:250–257. doi:10.2337/dc15-0258.
15. Dennis JM, Shields BM, Hill AV, et al. Precision Medicine in Type 2 Diabetes: Clinical Markers of Insulin Resistance Are Associated With Altered Short- and Long-term Glycemic Response to DPP-4 Inhibitor Therapy. Diabetes Care. 2018;41:705–712. doi:10.2337/dc17-1827.
16. Shmueli G. To Explain or to Predict? Stat Sci. 2010;25:289–310. doi:10.1214/10-STS330.
17. Collins GS, Moons KGM, Dhiman P, et al. TRIPOD+AI statement: updated guidance for reporting clinical prediction models that use regression or machine learning methods. BMJ. 2024;385:e078378. doi:10.1136/bmj-2023-078378.
18. Levey AS, Bosch JP, Lewis JB, et al. A more accurate method to estimate glomerular filtration rate from serum creatinine: a new prediction equation. Ann Intern Med. 1999;130:461–470. doi:10.7326/0003-4819-130-6-199903160-00002.
19. Friedman JH. Greedy function approximation: a gradient boosting machine. Ann Stat. 2001;29:1189–1232. doi:10.1214/aos/1013203451.
20. Pedregosa F, Varoquaux G, Gramfort A, et al. Scikit-learn: Machine Learning in Python. J Mach Learn Res. 2011;12:2825–2830. https://www.jmlr.org/papers/v12/pedregosa11a.html.
21. Varma S, Simon R. Bias in error estimation when using cross-validation for model selection. BMC Bioinformatics. 2006;7:91. doi:10.1186/1471-2105-7-91.
22. Cawley GC, Talbot NLC. On over-fitting in model selection and subsequent selection bias in performance evaluation. J Mach Learn Res. 2010;11:2079–2107. https://www.jmlr.org/papers/v11/cawley10a.html.
23. Steyerberg EW, Harrell FE Jr, Borsboom GJJM, et al. Internal validation of predictive models: efficiency of some procedures for logistic regression analysis. J Clin Epidemiol. 2001;54:774–781. doi:10.1016/S0895-4356(01)00341-9.
24. Van Calster B, McLernon DJ, van Smeden M, Wynants L, Steyerberg EW. Calibration: the Achilles heel of predictive analytics. BMC Med. 2019;17:230. doi:10.1186/s12916-019-1466-7.
25. Rousseeuw PJ. Silhouettes: a graphical aid to the interpretation and validation of cluster analysis. J Comput Appl Math. 1987;20:53–65. doi:10.1016/0377-0427(87)90125-7.
26. Hennig C. Cluster-wise assessment of cluster stability. Comput Stat Data Anal. 2007;52:258–271. doi:10.1016/j.csda.2006.11.025.
27. Labate AM, Moretti L, Villari P. Glycaemic and Cardiometabolic Effects of Oral Semaglutide in Patients Aged ≥65 Years with Type 2 Diabetes. Endocrines. 2026;7(1):8. doi:10.3390/endocrines7010008.
28. Labate AM, Cimino E, Giacomelli L, Ettori S, Oladeji OA, Agosti B. Molecular Pathways of Cardiometabolic Residual Risk in Type 2 Diabetes: Insulin Resistance, Metaflammation, and Liver–Kidney–Vascular Crosstalk. Int J Mol Sci. 2026;27(14):6170. doi:10.3390/ijms27146170.
29. Pollock C, Stefánsson B, Reyner D, et al. Albuminuria-lowering effect of dapagliflozin alone and in combination with saxagliptin and effect of dapagliflozin and saxagliptin on glycaemic control in patients with type 2 diabetes and chronic kidney disease (DELIGHT): a randomised, double-blind, placebo-controlled trial. Lancet Diabetes Endocrinol. 2019;7:429–441. doi:10.1016/S2213-8587(19)30086-5.
30. Waikar SS, Rebholz CM, Zheng Z, et al. Biological Variability of Estimated GFR and Albuminuria in CKD. Am J Kidney Dis. 2018;72:538–546. doi:10.1053/j.ajkd.2018.04.023.
31. Heerspink HJL, Greene T, Tighiouart H, et al. Change in albuminuria as a surrogate endpoint for progression of kidney disease: a meta-analysis of treatment effects in randomised clinical trials. Lancet Diabetes Endocrinol. 2019;7:128–139. doi:10.1016/S2213-8587(18)30314-0.
32. Labate AM, Villari P. Semaglutide across cardiovascular and kidney outcome trials: a systematic review and stratified synthesis. Rom J Diabetes Nutr Metab Dis. 2026;33(3):416–424. https://rjdnmd.org/index.php/RJDNMD/article/view/2399.
33. Hernán MA, Robins JM. Using Big Data to Emulate a Target Trial When a Randomized Trial Is Not Available. Am J Epidemiol. 2016;183:758–764. doi:10.1093/aje/kwv254.
34. Riley RD, Snell KIE, Ensor J, et al. Minimum sample size for developing a multivariable prediction model: Part I—Continuous outcomes. Stat Med. 2019;38:1262–1275. doi:10.1002/sim.7993.
35. Riley RD, Ensor J, Snell KIE, et al. Calculating the sample size required for developing a clinical prediction model. BMJ. 2020;368:m441. doi:10.1136/bmj.m441.
36. Moons KGM, Damen JAA, Kaul T, et al. PROBAST+AI: an updated quality, risk of bias, and applicability assessment tool for prediction models using regression or artificial intelligence methods. BMJ. 2025;388:e082505. doi:10.1136/bmj-2024-082505.
2026-11-26
Data Availability Statement
Participant-level clinical data are confidential and are not available for public sharing or external peer review. Aggregate results are reported in the manuscript and supplementary materials. The analytical code, without participant data, is provided in Supplementary Code 1.
Issue
Section
License
Copyright (c) 2026 Antonio Maria Labate and Provvidenza Villari

This work is licensed under a Creative Commons Attribution 4.0 International License.