Skip to content
Open access

An Interpretable XGBoost Model for Diabetes Prediction: Nested Cross-Validation, Calibration, and SHAP Analysis

2026 · International Journal of Medical and All Body Health Research · Vol 7, pp. 168-174 · 0 citations

TL;DR

Under a leakage-controlled, unbiased evaluation, XGBoost provided moderate but trustworthy discrimination together with well-calibrated probabilities for diabetes prediction, while SHAP confirmed clinically plausible predictors.

Abstract

Background: Diabetes mellitus is a major global health burden, and its early detection is essential for preventing serious complications. Machine learning, and eXtreme Gradient Boosting (XGBoost) in particular, performs strongly on routine clinical data; however, reported results are frequently optimistic because of hold-out evaluation and data leakage, and the resulting models are often difficult to interpret. Objective: To develop and rigorously evaluate an interpretable XGBoost model for predicting the presence of diabetes from eight routine diagnostic measurements, using an unbiased, leakage-controlled evaluation design. Methods: An openly available dataset of 1,168 patient records (771 non-diabetic and 397 diabetic; an approximately 66:34 class imbalance) with eight clinical features was analysed. Physiologically implausible zero values were treated as missing and imputed with the median inside a processing pipeline. Model selection and performance estimation were separated using a 5×5 nested cross-validation scheme, with all preprocessing confined to the training folds to prevent data leakage. Performance was assessed on out-of-fold predictions using accuracy, sensitivity, specificity, precision, F1 score, the area under the ROC curve (ROC-AUC), and the Brier score; probability calibration was examined; and the contribution of each feature was quantified with SHapley Additive exPlanations (SHAP). Results: The model achieved an ROC-AUC of 0.823, an accuracy of 0.769, a specificity of 0.859, a sensitivity of 0.595, a precision of 0.684, an F1 score of 0.636, and a Brier score of 0.160. The near-diagonal calibration curve and low Brier score indicated that the predicted probabilities were well calibrated and could be interpreted as reliable risk estimates. SHAP analysis identified glucose, body mass index, and age as the most influential predictors, in agreement with established clinical risk factors for diabetes. Conclusions: Under a leakage-controlled, unbiased evaluation, XGBoost provided moderate but trustworthy discrimination together with well-calibrated probabilities for diabetes prediction, while SHAP confirmed clinically plausible predictors. The comparatively conservative performance underscores the importance of nested cross-validation over simple hold-out splits for realistic model assessment. External validation and decision-threshold or class-imbalance strategies represent promising directions for future work.

Read PDF

Similar papers

Open access Aug 2026

An XGBoost-based predictive framework for diabetes mellitus multi-classification

Diabetes mellitus is a persistent metabolic condition that requires accurate and early diagnosis to prevent severe complications. This paper proposes an Extreme Gradient Boosting (XGBoost)-based predictive framework for multi-classification of diabetes mellitus into non-diabetic, pre-diabetic, and diabetic classes. Aft...

M. M. El Sherbiny, M. G. Abdel-Fattah, Ali E. Takieldeen et al. · 0 citations
Open access Aug 2026

Development, validation, and visualization of a machine learning-based predictive model for sarcopenia risk in patients with diabetes mellitus

Background Sarcopenia is a common complication in patients with diabetes mellitus (DM), yet early screening remains challenging due to the lack of accessible tools. This study aimed to develop and externally validate a machine learning (ML) -based predictive model for sarcopenia risk in DM patients, with enhanced inter...

Mingjie Tang, Shi-Yi Zheng, Hang Xu et al. · 0 citations
Open access Jul 2026

An interpretable machine learning framework for early-stage diabetes mellitus prediction using comparative classification models and SHAP

A machine learning-based framework enhanced with explainability is introduced, built around a structured data preparation process that handles categorical encoding, numerical scaling, and minority class oversampling through the SMOTE technique, positioning it as a trustworthy tool for assisting medical professionals in...

N. J, Deekshitha U, K. V · 0 citations
Open access Aug 2026

A HYBRID ANN-XGBOOST FRAMEWORK FOR EARLY DIABETES RISK PREDICTION UNDER CLASS IMBALANCE: EXTERNAL CLINICAL VALIDATION IN AN AFRICAN HEALTHCARE SETTING

Diabetes is one of the leading chronic diseases worldwide and remains a major public health challenge, particularly in low- and middle-income countries where limited diagnostic resources often delay early detection and treatment. Although machine learning has shown considerable promise for diabetes prediction, most exi...

Djiwa Ntela Oga, P. Houngue, Cheikh Sarr · 0 citations
Open access Jul 2026

Predictive modeling of early diabetes diagnosis: An evaluation of XGBoost, support vector machine, and random forest classifiers

It is recommended that healthcare systems adopt XGBoost-based predictive models in clinical decision support tools for early screening, while future studies should validate these models using real-world clinical data to enhance reliability and generalizability.

Idehen Emmanuel Imafidon, Chikere Obinna Munachiso, Dominic Evans Onyebuchi et al. · 0 citations
Open access Aug 2026

A Reliability-Aware and Interpretable Machine Learning Framework for Diabetes Prediction Using Structured Clinical Data

A reliability-aware and interpretable machine learning framework for diabetes prediction from structured clinical data is developed and a Feature Consistency Index (FCI) is formalised that quantifies the cross-model agreement of SHAP-derived feature importance and combines it with normalised importance into a single ra...

R. V., S. Sasirekha · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.