Explainable Diabetes Classification Using Machine Learning Algorithm and SHAP Analysis on Clinical Laboratory Data

  • Siti Agus Kartini * Mail Department of Information Systems, Universitas Tjuk Nyak Dhien, Medan, Indonesia
  • Muhammad Fauzi Department of Information Systems, Universitas Tjuk Nyak Dhien, Medan, Indonesia
  • Riki Winanjaya Department of Information Systems, STIKOM Tunas Bangsa, Pematangsiantar, Indonesia
Keywords: Diabetes Mellitus; Machine Learning; XGBoost; SHAP; Clinical Laboratory Data

Abstract

Diabetes mellitus is a chronic metabolic disorder that continues to pose significant health challenges worldwide due to its increasing prevalence and potential complications. Early and accurate identification of diabetes is essential to support timely intervention and effective disease management. Recent advances in machine learning have enabled the development of intelligent classification systems; however, many predictive models still suffer from limited interpretability, reducing their applicability in clinical environments. Therefore, this study proposes an explainable diabetes classification framework using machine learning algorithms and SHapley Additive exPlanations (SHAP) analysis on clinical laboratory data. The dataset consists of 1,000 patient records containing demographic and laboratory attributes, including age, gender, glycated hemoglobin (HbA1c), cholesterol, triglycerides, lipoprotein levels, creatinine, urea, and body mass index (BMI). Four machine learning algorithms, namely Decision Tree, Random Forest, Support Vector Machine (SVM), and Extreme Gradient Boosting (XGBoost), were developed and evaluated. The performance of each model was assessed using Accuracy, Precision, Recall, F1-Score, Classification Report, and Confusion Matrix. Experimental results indicate that Random Forest and XGBoost achieved the highest classification accuracy of 98.5%, outperforming Decision Tree (98.0%) and SVM (94.5%). Due to its strong predictive capability and compatibility with explainable artificial intelligence techniques, XGBoost was selected for further SHAP analysis. The SHAP results successfully identified the most influential features contributing to diabetes classification and provided transparent explanations regarding model predictions. The proposed framework demonstrates that combining machine learning algorithms with explainable artificial intelligence improves predictive accuracy and interpretability, supporting reliable clinical decision-making for diabetes diagnosis.

References

S. Chen et al., “The global macroeconomic burden of diabetes mellitus,” Nature Medicine, vol. 32, no. January, pp. 126–138, 2026, doi: 10.1038/s41591-025-04027-5.

I. Genitsaridi et al., “11th edition of the IDF Diabetes Atlas : global , regional , and national diabetes prevalence estimates for 2024 and projections for 2050,” The Lancet Diabetes & Endocrinology, vol. 14, no. 2, pp. 149–156, 2026, doi: 10.1016/S2213-8587(25)00299-2.

J. Hossain, Al‐Mamun, and R. Islam, “Diabetes mellitus, the fastest growing global public health concern: Early detection should be focused,” Health Science Reports, vol. 7, no. e2004, pp. 5–9, 2024, doi: 10.1002/hsr2.2004.

S. A. Alinaghian et al., “Burden of type 2 diabetes and its relationship with human development index in Asian countries: Global Burden of Disease Study in 2019,” BMC Public Health, vol. 25, no. 402, pp. 1–12, 2025, doi: 10.1186/s12889-025-21608-8.

C. Pan et al., “Global burden of diabetes mellitus 1990–2021: epidemiological trends, geospatial disparities, and risk factor dynamics,” Frontiers in Endocrinology, vol. 16, no. July, pp. 1–8, 2025, doi: 10.3389/fendo.2025.1596127.

B. Zhou et al., “Worldwide trends in diabetes prevalence and treatment from 1990 to 2022 : a pooled analysis of 1108 population- representative studies with 141 million participants,” The Lancet, vol. 404, no. 10467, pp. 2077–2093, 2024, doi: 10.1016/S0140-6736(24)02317-1.

A. Bawden, “More than 800 million people around the world have diabetes, study finds,” The Guardian, 2024. [Online]. Available: https://www.theguardian.com/society/2024/nov/13/diabetes-rates-increase-world-study?

W. M. Team, “Urgent action needed as global diabetes cases increase four-fold over past decades,” World Health Organization, 2024. [Online]. Available: https://www.who.int/news/item/13-11-2024-urgent-action-needed-as-global-diabetes-cases-increase-four-fold-over-past-decades

E. Ru, O. Ec, and M. Gi, “Complications Associated with Type 2 Diabetes Mellitus, Pathophysiology, Diagnosis and Management: A Concise Review of Current Literature,” Saudi Journal of Biomedical Research Abbreviated, vol. 10, no. 7, pp. 201–244, 2025, doi: 10.36348/sjbr.2025.v10i07.001.

K. Islam, R. Islam, I. Nguyen, H. Malik, and H. Pirzadah, “Diabetes Mellitus and Associated Vascular Disease : Pathogenesis , Complications , and Evolving Treatments,” Advances in Therapy, vol. 42, no. 6, pp. 2659–2678, 2025, doi: 10.1007/s12325-025-03185-9.

Z. Shariat-madar and F. Mahdi, “Potential Molecular Biomarkers for Predicting and Monitoring Complications in Type 2 Diabetes Mellitus,” Molecules, vol. 30, no. 22, pp. 1–48, 2025, doi: 10.3390/molecules30224448.

G. Manoukian et al., “Post-COVID Syndrome in Patients With Comorbid Hypertension or Diabetes: A Narrative Review of Long-Term Outcomes,” Cureus, vol. 18, no. 1, pp. 1–12, 2026, doi: 10.7759/cureus.102117.

O. B. Ayoade, S. Shahrestani, and C. Ruan, “Comparative Epidemiology of Machine and Deep Learning Diagnostics in Diabetes and Sickle Cell Disease: Africa’s Challenges, Global Non-Communicable Disease Opportunities,” Electronics, vol. 15, no. 2, pp. 1–41, 2026, doi: 10.3390/electronics15020394.

S. Cassambai et al., “Strengthening diabetes care in sub-Saharan Africa: health systems, digital innovations, lifestyle interventions, and socioeconomic dimensions,” The Lancet Diabetes and Endocrinology, vol. 14, no. 6, pp. 523–532, 2026, doi: 10.1016/S2213-8587(26)00035-5.

D. Ikhile, S. Seidu, D. Omodara, J. C. Katte, K. Ramaiya, and K. Khunti, “Diabetes-related complications and multiple long-term conditions in sub-Saharan Africa: determinants and management strategies,” The Lancet Diabetes and Endocrinology, vol. 14, no. 6, pp. 512–522, 2026, doi: 10.1016/S2213-8587(26)00036-7.

A. Mannucci and A. Goel, “Advances in pancreatic cancer early diagnosis, prevention, and treatment: The past, the present, and the future,” Ca-A Cancer Journal for Clinicians, vol. 76, no. 1, pp. 1–30, 2026, doi: 10.3322/caac.70035.

X. Yao, D. Huang, X. Shi, and F. Xiang, “Clinical ef fi cacy , safety , and predictors of treatment response to SGLT2 versus DPP- 4 inhibitors in type 2 diabetes : a retrospective comparative study,” Frontiers in Endocrinology, vol. 17, no. May, pp. 1–15, 2026, doi: 10.3389/fendo.2026.1818019.

I. Z. Sadiq et al., “Data-driven diabetes mellitus prediction and management: a comparative evaluation of decision tree classifier and artificial neural network models along with statistical analysis,” Scientific Reports, vol. 15, no. 19339, pp. 1–16, 2025, doi: 10.1038/s41598-025-03718-w.

Y. Zhuang et al., “The effect of multidisciplinary team and experience-based co-design on the care of older adult patients with type 2 diabetes: A randomized controlled trial,” Diabetes Research and Clinical Practice, vol. 221, no. March, p. 112028, 2025, doi: 10.1016/j.diabres.2025.112028.

L. N. Adam, “Association between dyslipidemia and glycated hemoglobin in diabetic patients from Zakho General Hospital, Iraq,” The Egyptian Journal of Internal Medicine, vol. 37, no. 70, pp. 1–6, 2025, doi: 10.1186/s43162-025-00460-7.

S. Singh, N. A. Wani, R. Kumar, and J. Bedi, “DiaXplain: A transparent and interpretable artificial intelligence approach for Type-2 diabetes diagnosis through deep learning,” Computers and Electrical Engineering, vol. 126, no. August, p. 110470, 2025, doi: 10.1016/j.compeleceng.2025.110470.

S. Mukherjee and D. De, “XAI-IoT based real-time diabetes prediction using TabTransformer,” Medicine in Novel Technology and Devices, vol. 30, no. May, p. 100435, 2026, doi: 10.1016/j.medntd.2026.100435.

M. Elfayoumi, M. AbouElazm, O. Mohamed, T. Abuhmed, and S. El-Sappagh, “Knowledge Augmented Significant Language Model-Based Chatbot for Explainable Diabetes Mellitus Prediction,” in 2025 19th International Conference on Ubiquitous Information Management and Communication (IMCOM), 2025, pp. 1–8. doi: 10.1109/IMCOM64595.2025.10857525.

O. O. Awe, P. N. Mwangi, S. K. Goudoungou, R. V. Esho, and O. S. Oyejide, “Explainable AI for enhanced accuracy in malaria diagnosis using ensemble machine learning models,” BMC Medical Informatics and Decision Making, vol. 25, no. 162, pp. 1–26, 2025, doi: 10.1186/s12911-025-02874-3.

H. Fan, Z. Li, N. Yan, and H. Liu, “Scientific Reports Article in Press An interpretable progressive residual network for automated multiclass diabetes diagnosis IN AR IN,” Scientific Reports, vol. May, pp. 1–50, 2026, doi: 10.1038/s41598-026-51603-x.

A. Ashraf et al., “A preprocessing-enhanced stacking classifier for generalized cardiovascular disease detection across diverse datasets,” Scientific Reports, vol. 16, no. 16206, pp. 1–16, 2026, doi: 10.1038/s41598-026-41042-z.

Z. Ding et al., “Trade-offs between machine learning and deep learning for mental illness detection on social media,” Scientific Reports, vol. 15, no. 14497, pp. 1–14, 2025, doi: 10.1038/s41598-025-99167-6.

L. Jiang et al., “Assessment of six insulin resistance surrogate indexes for predicting stroke incidence in Chinese middle-aged and elderly populations with abnormal glucose metabolism: a nationwide prospective cohort study,” Cardiovascular Diabetology, vol. 24, no. 56, pp. 1–13, 2025, doi: 10.1186/s12933-025-02618-7.

R. Hasan, V. Dattana, S. Mahmood, and S. Hussain, “Towards Transparent Diabetes Prediction : Combining AutoML and Explainable AI for Improved Clinical Insights,” Information, vol. 16, no. 7, pp. 1–31, 2025, doi: 10.3390/info16010007.

M. Kutlu, T. B. Donmez, and C. Freeman, “Machine Learning Interpretability in Diabetes Risk Assessment: A SHAP Analysis,” Computers and Electronics in Medicine, vol. 1, no. 1, pp. 34–44, 2024, doi: 10.69882/adba.cem.2024075.

M. Islam, H. R. Rifat, S. Bin Shahid, A. Akhter, A. Uddin, and K. M. M. Uddin, “Explainable Machine Learning for Efficient Diabetes Prediction Using Hyperparameter Tuning, SHAP Analysis, Partial Dependency, and LIME,” Engineering Reports, vol. 7, no. e13080, pp. 1–22, 2024, doi: 10.1002/eng2.13080.

P. Netayawijit, W. Chansanam, and K. Sorn-In, “Interpretable Machine Learning Framework for Diabetes Prediction: Integrating SMOTE Balancing with SHAP Explainability for Clinical Decision Support,” Healthcare, vol. 13, no. 20, pp. 1–26, 2025, doi: 10.3390/healthcare13202588.

Z. Rafie et al., “Leveraging XGBoost and explainable AI for accurate prediction of type 2 diabetes,” BMC Public Health, vol. 25, no. 3688, pp. 1–17, 2025, doi: 10.1186/s12889-025-24953-w.

R. Agarwal, K. K. Gangwar, A. Pandey, V. Sharma, and A. Sanghi, “Integrating XGBoost with Explainable AI Techniques for Diabetes Prediction: A Comparative Study,” in 2025 14th International Conference on System Modeling & Advancement in Research Trends (SMART), IEEE, 2025, pp. 513–519. doi: 10.1109/SMART66937.2025.11389515.

S. Ahmad, S. Hussain, M. Arif, and M. A. Ansari, “Early-Stage Diabetes Prediction Using a Stacked Ensemble Model Enhanced with SHAP Explainability,” Biomedical and Pharmacology Journal, vol. 19, no. 1, pp. 246–263, 2026, doi: 10.13005/bpj/3350.

A. Wanto, Y. Yuhandri, and O. Okfalisa, “RetMobileNet: A New Deep Learning Approach for Multi-Class Eye Disease Identification,” Revue d’Intelligence Artificielle, vol. 38, no. 4, pp. 1055–1067, 2024, doi: 10.18280/ria.380401.

S. P. Siregar, I. Akbari, Poningsih, A. Wanto, and Solikhun, “Enhancing Tomato Leaf Disease Detection via Optimized VGG16 and Transfer Learning Techniques,” Jurnal RESTI, vol. 9, no. 3, pp. 570–580, 2025, doi: 10.29207/resti.v9i3.6410.

A. I. R. H. Barat, W. S. Astuti, D. Hartama, A. P. Windarto, and A. Wanto, “Enhanced Flower Image Classification Using Mobilenetv2 With Optimized Performance,” JITK (Jurnal Ilmu Pengetahuan dan Teknologi Komputer), vol. 11, no. 1, pp. 180–191, 2025, doi: 10.33480/jitk.v11i1.6497.

H. R. M. W. Jasa, A. Wanto, and R. K. Sormin, “Optimization of ShuffleNetV2 Using Self-Knowledge Distillation for Cocoa Fruit Disease Classification,” Jurnal Teknik Informatika (JUTIF), vol. 7, no. 3, pp. 2670–2689, 2026, doi: 10.52436/1.jutif.2026.7.3.5649.

Dimensions Badge
Published
2026-07-28
Section
Articles