Skip to main content
Frontiers in Digital Health logoLink to Frontiers in Digital Health
. 2026 Oct 14;8:1952669. doi: 10.3389/fdgth.2026.1952669

Development of an explainable machine learning framework for early diabetes detection, multiclass classification, and risk stratification across age groups

Nosizo Lukhele 1, Fahad Mostafa 1,*
PMCID: PMC13713680  PMID: 42953022

Abstract

Objective

To develop and evaluate a novel machine learning (ML) framework tailored to a clinical diabetes dataset and to assess whether demographic stratification enhances model performance and interpretability for multiclass diabetes classification.

Methods

A clinical dataset of 264 patients' records was used to classify individuals including non-diabetic (36.4%), prediabetic (15.2%), and diabetic (48.5%) individuals. Several supervised learning models were trained using 80:20 train-test split and optimized using RandomizedSearchCV and 10-fold cross validation. Model performance was evaluated using the metrics accuracy, precision, recall and the F1-score. Area under the receiver operating characteristic curve (AUC) was calculated for the best generalizing model. A structured ML framework was developed for this dataset, incorporating preprocessing, model optimization, age stratification analysis age (<35 vs ≥35 years) and gender. SHAP was developed for model interpretability.

Results

Ensemble methods demonstrated superior performance in comparison to linear or single-tree approaches, with Gradient Boosting showing the most stable generalization with a test accuracy of 0.981 and stable cross validation accuracy of 0.972. AUC-ROC analysis using Gradient Boosting yielded good discriminative ability across the three diabetes classes: 0.991 (non-diabetic), 0.986 (prediabetic) and 0.972 (diabetic). Stratified analysis showed improved reliability in individuals aged ≥35 years (accuracy = 0.94, F1-score = 0.92), while performance in younger individuals was unstable due to small sample size. SHAP analysis identified HbA1c, BMI, and age as dominant predictors.

Conclusion

This study presents a ML framework integrating age stratified modelling with explainable ML frameworks to improve interpretability. The findings offer clinically relevant results that can support clinical decision-making systems, individualized risk assessment, and potential applications for targeted intervention in diabetes progression.

Keywords: diabetes, explainable AI, machine learning, multiclass classification, risk stratification

Introduction

Diabetes Mellitus is a chronic metabolic disorder characterized by high blood glucose levels (hyperglycemia) due the underutilization and overproduction of glucose (1). According to the International Diabetes Federation Diabetes Atlas, In 2019 it was reported that about 50% of people with diabetes were unaware that they have the disease, and by 2030, the prevalence is projected to increase to approximately 10.2% (578 million) (2). Similarly, the World Health Organization predicted that diabetes would affect around 425 million people between the ages 20–79 years in 2023 and this figure is projected to increase to 629 million by 2045 (3). The reason people go unaware that they have the disease or are at risk is because diabetes is largely asymptomatic and people do not preventatively screen for it until it has advanced. Delayed diagnosis of diabetes can lead to many preventable complications such as retinopathy, neuropathy, heart attacks and even strokes (4). This makes diabetes a global concern, warranting the need for early detection and accurate diagnosis stage classification. Diabetic risk is influenced by a combination of factors including age, BMI and biochemical factors. However, these clinical and sociodemographic factors are also shaped by genetics, lifestyle habits and one's environmental exposures (5). As a result, sole reliance on clinical thresholds is limiting and might not fully represent the dynamic as well as progressive nature of metabolic dysregulation (6). This dependence on conventional clinical thresholds may result in underdiagnosis and delayed detection of individuals in intermediate stages, particularly those with prediabetes, reducing opportunity for early intervention (7). Talaschian et al. (2026) showed that HbA1c screening varies by age and sex, with younger adults especially women requiring lower diagnostic thresholds for accurate detection (8), highlighting the limitations of universal diagnostic thresholds. As a result, clinicians need advanced data driven approaches and new technologies in order to deliver personalized diagnostic assessment and provide targeted intervention.

Machine learning (ML) has emerged as a promising approach for diabetes risk prediction by integrating multidimensional clinical data to identify complex nonlinear patterns that are difficult to capture using conventional statistical methods or standardized screening tools (9). Numerous studies have demonstrated the reliability and predictive capability of ML algorithms for diabetes classification and risk assessment (10, 11). For example, Zhao et al. (2025) reported strong predictive performance for identifying the progression from gestational diabetes to type 2 diabetes (12), while Aragão et al. (2025) demonstrated that binary, multiclass, and multilabel ML classifiers consistently achieved robust performance across real-world applications (13). Collectively, these findings highlight the potential of modern ML techniques to improve prediction accuracy and support more effective clinical decision-making through advances in computational methods and algorithmic design.

Despite the strong demonstrated performance, several research gaps remain. First, many of the existing ML studies frame diabetes prediction as a binary classification task (diabetic vs. non-diabetic), which oversimplifies the disease since it progresses along a continuum. Prediabetes in particular is a very clinically meaningful stage where early intervention is most effective, hence it is important to classify this stage in modelling. Second, most ML frameworks apply a single universal model across heterogeneous populations, with limited investigation into whether model performance varies across demographic subgroups such as age and gender, which may limit model generalizability across different subgroups. To address these limitations, this study contributes to literature by integrating three complementary components within a unified analytical framework to show that machine learning can support clinicians with timely insights that enable clinicians to tailor treatments strategies.

Age was selected as the primary demographic stratification variable because it represents a clinically actionable characteristic that is independent of disease status and directly aligns with current diabetes screening recommendations. Both the American Diabetes Association (ADA) and the U.S. Preventive Services Task Force (USPSTF) recommend routine diabetes screening from 35 years of age, recognizing age as an important determinant of diabetes risk and screening decisions. In contrast, variables such as HbA1c, body mass index (BMI), lipid profile, creatinine, and urea are established clinical biomarkers that directly reflect an individual's metabolic state. These variables were therefore retained as predictive features within the machine learning models rather than used for stratification, allowing the algorithms to fully learn their relationships with diabetes progression. Stratifying the cohort by these biomarkers would artificially partition the feature space and could diminish their predictive contribution while increasing the risk of information leakage. Consequently, age serves as an appropriate demographic variable for subgroup analysis, whereas the remaining clinical and laboratory measurements function as explanatory predictors within the proposed explainable machine learning framework.

In this paper, we have added the following contributions.

  • Demographic-stratified modeling framework: This study contributes to literature by proposing a novel machine learning pipeline that evaluates age-based strata (<35 vs. ≥35 years). This approach is grounded in updated screening recommendations from the US Preventive Service Task Force (USPSTF) and the American Diabetes Association (ADA), which lowered the diabetes screening age to 35 years to promote earlier detection and treatment (14). This moves beyond applying universal models across heterogeneous populations and enables the uncovering of disease patterns distinct to specific subgroups or people.

  • Development of Multiclass diabetes stage prediction: Unlike most ML approaches that simplify diabetes prediction into binary classification, this work models diabetes into three stages (non-diabetic, prediabetic, diabetic), providing a more clinically relevant representation of the disease.

  • Development of explainable artificial intelligence Integration: By including SHAP within the framework, will enhance the interpretability and applicability of the ML models towards disease risk minimization (15, 16).

  • Identification of stage and subgroup-specific risk patterns: The integration of stratification and explainability will reveal how the importance of key predictors varies across age groups. This enables a more precise characterization of age-dependent risk profiles and supports more personalized risk assessment strategies.

These contributions greatly advance the modelling methodology of diabetes prediction and most importantly supports clinical decision making by demonstrating that interpretable, data-driven ML models can reliably enhance disease diagnosis and prognosis (17).

The article is organized as follows. The first section is the Introduction section: It introduces the clinical context, motivation and key research objectives. The second section: Literature Review examines existing works on machine learning approaches for diabetes prediction, highlighting current limitations. Third section: Methods describe the dataset, preprocessing steps, model development including the demographic stratification, evaluation frameworks and explainable AI technique used. The Fourth section: the Results present the performance of the ML models, subgroup analyses and SHAP- interpretations. Finally, the fifth section: Discussion & Conclusions summarizes the major findings and outlines what the implications are for public health and proposes what future research should aim towards.

Literature review

Machine learning (ML) is a subset of artificial intelligence which enables computers, by employing statistical methods, to learn patterns in data and make autonomous decisions (18). In recent years there has been a great investment in examining the significance of machine learning applicability in predicting chronic diseases, including cardiovascular disease, diabetes, cancer, liver, and neurological disorders (19). Afsaneh et al. (2022) comprehensively reviewed the applications of machine learning in diabetes, disclosing that ML is a promising approach for diagnosis and management of diabetes (20). Abd et al. (2024) assessed ML algorithms, including XGBoost, Random Forest. Decision Tree, Support Vector Machine and Gradient Boosting for diabetic retinopathy (DR), highlighting that ML can facilitate early detection of DR in diabetic patients (21). Similarly, Ghosh et al., 2025 developed classification models, demonstrating that they can precisely predict a patient's diabetic status based on various health indicators (22). Ashisha et al. (2023) evaluated five interpretable ML algorithms and revealed the Random Forest technique outperformed all other ML techniques by achieving 98% precision, 98% recall, 98% F1-score, 75% sensitivity, 96% specificity, and accuracy of 97.5% (23). Metwally et al., (2024) showed that ML can identify sub phenotypes such as muscle or hepatic insulin resistance, β-cell dysfunction, and impaired incretin effect (24), demonstrating the efficacy of ML to uncover underlying features that aid the risk stratification of individuals with early glucose dysregulation. Zargoush et al., (2025) investigated the use of ML for prescriptive analysis, showing that ML can also be used to make personalized treatment decisions (25). All of this indicates that the real-world applications of these models are increasingly evident and has the potential to benefit clinicians in providing actionable insights, streamlining patient monitoring, and supporting data-driven decision-making.

In addition to finding that ML models are consistently better at predicting diabetes, studies also highlight the importance of feature selection methods (26). Michelucci, (2024) specifically lists the relevance of feature selection in healthcare regarding hospital readmissions, stating that it helps providers pinpoint the most critical predictors of readmission which can help hospitals on how to optimize management, provide targeted interventions and inform the allocation of resources efficiently (27). A study by Gürsoy & Alkan, A. (2022) investigated diabetes data with permutation feature importance based deep learning methods and revealed that the HbA1c feature is an important parameter in the model's classification success (28). Cahyani & Irsyada, (2025) compared permutation importance vs. select best for feature selection across multiple classifiers and found that permutation feature importance led to improved model performance, supporting its use for identifying influential clinical predictors (29). Della Corte et al., (2025) reports permutation importance alongside SHAP to derive clinically coherent feature reliance patterns in ML models predicting incident diabetes outcomes (30).

Although there has been an evident rise in the use of ML models that have proven effective in enhancing prediction accuracy, their “black box” nature often limits their interpretability and transparency (31). This lack of explainability makes it difficult for the models to be adopted for clinical use, because healthcare providers must understand the logic behind the decision in order to confidently relay the information to patients. Therefore, to address this limitation interpretable frameworks like SHAP (Shapley additive explanations) have been increasingly incorporated into diabetic prediction studies (32, 33). In large scale population analysis, SHAP has effectively been used to identify key predictors like HbA1c, BMI and age, which demonstrated consistency with what is already established as risk factors in epidemiological studies and reinforced the biological plausibility of ML outputs (34). Similarly, Prendin et al., (2025) discussed the importance of using tools to interpret the output of black-box models in type I diabetes management and showed that SHAP uncovered patient specific feature dynamics in blood glucose prediction, which could enable clinicians to better understand temporal glucose variability and individualized metabolic responses (35). Collectively, these findings highlight that SHAP-based explainability improves model interpretability and above all strengthens the bridge between algorithm prediction and clinical reasoning which in turn supports more transparent, reliable as well as patient centered decision support systems in diabetic care.

In this project several models were used: Random Forest, Support Vector Machines (SVMs), Logistic Regression, Decision Tree, XGBoost and Gradient Boosting, all of which are shown to have established effectiveness in medical classification tasks. Random forest is recognized as one of the most powerful and efficient techniques (36). It was selected because it enables feature importance selection, which supports clinical interpretability by helping clinicians to understand which factors matter (37, 38). Support Vector machines are valuable because they minimize empirical classification errors while increasing geometric margin (39). Logistic regression is foundational because it is good at understanding the relationship between the dependent variable and independent variables, making it suitable for categorical disease outcomes (40). Ensemble methods such as XGBoost and Gradient Boosting improve prediction accuracy and generalizability by iteratively improving on difficult-to-classify instances, minimizing wrong predictions (41) and offering hyperparameter tuning (42). Together these models provide a complementary toolkit for disease prediction and classification.

Methods

This is a study aimed at predicting diabetes using machine learning into three classes and using explainable artificial intelligence techniques. The data supporting the findings of this study are available online (43). This study consists of four main steps: First, data was collected and preprocessed to ensure data quality. Next, permutation feature importance was conducted to rank the importance of each feature in diabetes prediction. Then different machine learning models were tuned using RandomizedSearchCV, trained and evaluated to identify the best algorithms for predicting diabetes. Lastly, SHAP technique was employed to interpret the model's prediction outcomes for 6 cases across the classes and age groups. All the stages of this project are outlined by the graphical abstract shown in Figure 1.

Figure 1.

Flowchart illustrating a machine learning pipeline for diabetes risk prediction, covering patient data gathering, exploratory analysis and preprocessing, model development, advanced interpretation, multiclass classification, and clinical insights. Visuals emphasize data features, preprocessing steps, model types, interpretability outputs, and actionable clinical translation for personalized care.

Graphical Abstract. The Explainable ML framework for Diabetic Risk Prediction: Advanced Interpretability-Centric Machine Learning Framework for Multiclass Diabetes Risk Assessment: From Raw Patient Data to Transparent Clinical Action.

Study population

The data for this study was collected from the Iraqi society by the laboratory of Medical City Hospital and the Center for Endocrinology and Diabetes Teaching Hospital (44). The cohort comprises health data extracted from patient files into the database constructing the diabetes dataset. Each patient record included demographic variables (age, gender), the anthropometric measure body mass index (BMI) and laboratory measures (haemoglobin A1c, lipid panel, creatinine and urea). A total of 264 individuals were included in the analysis, and these included 129 females and 144 males aged 25–77 years. Figure 2 shows how the categorical variables, gender and diabetes class, were distributed in the dataset. The dataset comprised participants, including 96 non-diabetic (36.4%), 40 prediabetic (15.2%), and 128 diabetic (48.5%) individuals. The dataset exhibited moderate class imbalance. Therefore, stratified train-test splitting, stratified cross-validation, and macro-averaged performance metrics will be used to ensure unbiased model evaluation without altering the original class distribution to preserve the original clinical data distribution and maintain real-world applicability.

Figure 2.

Bar chart (a) compares counts among non-diabetic, prediabetic, and diabetic groups with values of ninety-six, forty, and one hundred twenty-eight respectively. Bar chart (b) compares counts for females and males, with values of one hundred twenty and one hundred forty-four respectively.

Class and gender distribution analysis. Panel a) presents the distribution of data points across the different diabetes risk classes (non-diabetic, prediabetic, and diabetic). Panel b) displays the distribution of the study cohort by gender (females and males). The numerical values above each bar indicate the specific counts.

Dataset preprocessing

The dataset contained ten continuous variables (AGE, Urea, Cr', HbA1c, Chol, TG, HDL, LDL, VLDL, BMI]. Exploratory data analysis (EDA) was done to assess variable distribution. For the continuous variables, a summary statistics table with means, standard deviations, medians and interquartile range were computed. Box plots (Figure 3) were created to assess the presence of any outliers and skewness in the data. The box plots revealed that there was a right skewed distribution across a majority of the variables. We see this with variables such as Creatinine (Cr), Urea and VLDL, as demonstrated by the right extending tails of upper outliers. This distribution pattern is typical of medical datasets due to patients experiencing acute or severe conditions. Variables like Age and BMI on the other hand exhibited a tighter, more normally distributed spread. Lastly, continuous variables were standardized in order to make sure that they contributed proportionally to the model training.

Figure 3.

Two boxplot charts compare distributions of diabetes-related features. Panel a shows small-scale features: HbA1c, cholesterol, TG, HDL, LDL, VLDL, urea, and BMI with several outliers. Panel b presents large-scale features: age and creatinine (Cr), with creatinine having more dispersed values and many outliers. Both charts use different value scales on the x-axis, facilitating feature comparison among diabetes predictors.

Comprehensive distribution analysis of Key clinical and biological features from the diabetes dataset. Panel a) (left) displays the distribution of smaller-scale features (HbA1c, Lipids, Urea, BMI), highlighting their variability and outliers. Panel b) (right) shows the wider-scale features of AGE and Creatinine (Cr), demonstrating their distinct, larger value ranges and extreme high-value outliers.

Model development

A series of supervised machine learning models, Random Forest, Logistic Regression, Support Vector Machine, Gradient Boosting, Decision Tree, and XGBoost, were chosen for classifying patients into 3 diabetes classes. These six models were chosen based on their established performance in medical classification tasks and suitability of tabular health data (45). Before the models were trained, the dataset was encoded, standardized, split into 80% for training and 20% for testing in order to allow unbiased evaluation of the model's performance. Proportions of the train and test set were inspected to ensure consistent distribution. model selection and reduce variability arising from a single data partition, hyperparameter optimization was performed using 100 repetitions of stratified 10-fold cross-validation within the RandomizedSearchCV framework (46). This was done by predefining the parameters for each classifier, then randomized iterations were executed per model with tenfold cross validation, after which the best hyperparameters identified for each model were re-fit on the full training set before evaluation. Table 1 summarizes the optimal parameters for each of the utilized models. Performance was averaged across the repeated cross-validation folds, providing a stable estimate of each candidate model's generalization ability. After selecting the optimal hyperparameters, the final model was retrained on the complete training set and evaluated once on the independent 20% hold-out test set. This repeated cross-validation strategy minimizes sampling bias and reduces the likelihood that model selection is influenced by a favorable random split. Moreover, to prevent data leakage, all preprocessing and model development steps were performed exclusively using the training data. During each fold of the 10-fold cross-validation implemented within RandomizedSearchCV with 100 repeats, preprocessing operations, including feature scaling and any model-specific transformations, were fitted only on the training partition and subsequently applied to the corresponding validation partition using the learned parameters.

Table 1.

Summary of hyperparameters and optimal values for machine learning classification models.

Model Hyperparameter Tuning Parameters Optimal Value
Random Forest n_estimators: number of trees in the forest [100, 200, 300] 200
max_depth [None, 10, 20, 30] 10
min_samples_split  [2, 5, 10] 5
min_samples_leaf [1, 2, 4] 1
bootstrap  [True, False] False
Logistic Regression C [0.1, 1.0, 10.0] 10.0
solver [‘lbfgs'] lbfgs
Support Vector Machine C [0.1, 1.0, 10.0] 10.0
kernel [‘linear', ‘rbf'] linear
gamma  ['scale', ‘auto'] auto
Gradient Boosting n_estimators [100, 200, 300] 200
learning_rate [0.01, 0.1, 0.2] 0.1
max_depth [3, 5, 7] 5
Decision Tree max_depth [None, 10, 20, 30] 10
min_samples_split [2, 5, 10] 5
min_samples_leaf [1, 2, 4] 2
XGBoost n_estimators [100, 200, 300] 300
learning_rate [0.01, 0.1, 0.2] 0.01
max_depth [3, 5, 7] 7
colsample_bytree [0.7, 0.8, 1.0] 0.7
subsample [0.7, 0.8, 1.0] 0.7

Moreover, in the computational setting for each model, 50 randomized parameter combinations were evaluated (n_iter = 50), with candidate configurations sampled uniformly from the predefined hyperparameter distributions. Model performance during cross-validation was assessed using the macro-averaged F1-score (scoring = ‘f1_macro'), which was selected because it provides balanced evaluation across the three diabetes classes irrespective of class frequencies. To ensure reproducibility, a fixed random seed (random_state = 42) was used for both the randomized search procedure and the train-test data split wherever applicable. The optimal hyperparameter configuration was selected as the parameter set achieving the highest mean cross-validation macro F1-score and was subsequently retrained on the complete training dataset before final evaluation on the independent test set.

Also, a post hoc statistical power analysis was performed to assess the adequacy of the available sample size. Using Cohen's medium effect size (f = 0.25), a significance level of α = 0.05, and a total sample size of 264 participants, the achieved statistical power exceeded 95%, indicating that the available cohort was sufficiently powered for detecting moderate effects in the proposed multiclass classification framework.

Evaluation metrics

Model performance was quantified using the following metrics. For the equations TP, TN, FP, and FN denote true positives, true negatives, false positives, and false negatives, respectively.

Accuracy: Measures the amount of correct predictions the model made. It is defined as:

Accuracy=TP+TNTP+TN+FP+FN

Precision: Gives the ratio of true positive predictions to the total predicted positives. Its equation is:

Precision=TPTP+FP

Recall: Reflects the ability of the model to identify all relevant instances. It is calculated as follows:

Recall=TPTP+FN

F1-score: Balances the precision and recall metrics giving us the harmonic mean of both these metrics. It is very useful in imbalanced data sets as it balances the tradeoff between false positives and false negatives. It is calculated as:

F1−score=2*Precision*RecallPrecision+Recall

For the multiclass setting, these metrics were computed using macro-averaging so that each diabetes class contributes equally to the final evaluation, regardless of the respective class sample size, whereby each diabetes class (non-diabetic, prediabetic, and diabetic) contributes equally to the overall performance regardless of class frequency. This averaging strategy was selected to ensure balanced assessment across all clinically relevant disease stages.

Feature importance

The project also conducted a feature importance analysis to rank features based on how well they predicted outcomes (47). Feature importance was evaluated using both Random Forest Mean Decrease in Impurity (MDI) and permutation importance. The MDI measures the contribution of each feature to impurity reduction during tree construction and permutation importance assesses the decrease in model performance when feature values are randomly shuffled, providing a model-agnostic estimate of feature relevance. This makes it easy to comprehend how the key characteristics of diabetes dominantly impact the model's performance.

Demographic stratification

Subgroup analyses by age and gender were also conducted to evaluate the model's performance across clinically relevant subgroups. For age, two age strata were formed using the recommended diabetic screening cut-point of 35 years (48, 49). We then categorize gender into male and female. The strata were applied to the entire dataset prior to the model being trained. A Gradient Boosting classifier was trained and evaluated following the same pipeline implemented in the primary analysis. The age threshold of 35 years was selected a priori based on contemporary clinical practice guidelines rather than being data-driven. The 2021 U.S. Preventive Services Task Force (USPSTF) recommendation and subsequent American Diabetes Association (ADA) guidance lowered the recommended age for routine screening for prediabetes and type 2 diabetes to 35 years among adults at increased risk, reflecting growing evidence that earlier screening improves detection of undiagnosed disease and prediabetes (50–52). Using this clinically established threshold allowed the stratified analyses to align with current screening practice and increased the clinical interpretability of the proposed machine learning framework

Explainable artificial intelligence (XAI) techniques

The SHAP method was used to help the interpretability and transparency of the models. SHAP uses Shapely values to explain the contribution of each feature on the model's prediction. A Shapely value is described as the average marginal contribution of a feature value across all possible coalitions (53). Knowing how much each feature contributes to the model's decision allows clinicians to understand what drove the prediction for that individual. SHAP was chosen because it is good at horning in on specific model behaviors with more precision, which helps boost trust and interpretability. Kabir et al., (2025) discusses how there exists a tradeoff dilemma between accuracy and interpretability with highly accurate deep learning models due to their complexity which often leads users to accept reduced performance in exchange for more interpretable models, however techniques like SHAP help balance this trade off (54). Similarity, Paliwal et al., (2025) emphasizes that explainable AI techniques bridge the gap between model complexity and user trust because they highlight detailed, targeted explanations on these high performing models (55). SHAP was chosen over other explainable techniques because it has a strong theoretical foundation rooted in Shapley values, ensuring fair distribution of feature contributions (56). Moreover, SHAP can be used on any supervised ML model and is more robust and consistent compared to LIME which bases its explanation on random sampling often leading to multiple explanations for the same instance (57). Additionally, SHAP offers both local and global interpretability, which means they don't only provide the interpretability for one prediction but also how the model functions as a whole (58). These advantages support what has led to the widespread utilization of SHAP in literature especially in key domains like healthcare.

To enhance the interpretability of the machine learning framework, SHAP was applied to the final selected classifier using the appropriate SHAP explainer for the trained model. SHAP assigns each feature a Shapley value that quantifies its contribution to the model prediction based on cooperative game theory (53, 56). Two complementary levels of explanation were generated. First, global explanations were obtained using SHAP summary plots to evaluate the overall importance and direction of influence of each clinical feature across the study population. Second, local explanations were generated using SHAP force plots for representative patient cases to illustrate how individual feature values contributed to each prediction. This combination of global and local explanations improves transparency by providing both population-level understanding of model behavior and patient-specific interpretation, thereby supporting clinically meaningful and trustworthy decision-making (32–35, 54–58).

Results

Six models were trained, tuned and evaluated to classify diabetes status. Across all evaluated classifiers, ensemble-based methods achieved the strongest predictive performance for multiclass diabetes classification. Results are visualized in Figure 4. XGBoost emerged as the top-performing model, achieving the highest accuracy (1.00), precision (1.00), recall (1.00), and F1-score (1.00), indicating near-perfect performance on this dataset, likely influenced by dataset size and structure.

Figure 4.

Bar chart comparing six machine learning models—Random Forest, Logistic Regression, Support Vector Machine, Gradient Boosting, Decision Tree, and XGBoost—across four performance metrics: accuracy, precision, recall, and F1-score. XGBoost consistently achieves the highest score of one point zero for all metrics, while Random Forest has the next highest scores. The scores for all other models are slightly lower but close to each other.

Comparative evaluation of machine learning model performance across key classification metrics (accuracy, precision, recall, F1-score). The bar chart provides a side-by side evaluation of the models. Numerical annotations above the bar provide exact performance coefficients, facilitating a direct assessment of model reliability and classification precision.

The Random Forest model also performed strongly, with an accuracy of 0.962, recall of 0.917 and an F1-score of 0.940. Gradient Boosting demonstrated moderate performance, achieving an accuracy of 0.906 with balanced precision (0.912) and recall (0.893), suggesting stable classification capability. In contrast, the Support Vector Machine and Logistic Regression models showed comparatively lower performance, particularly in precision and F1-score, reflecting reduced effectiveness in handling class boundaries within the multiclass setting. The Decision Tree model performed better than linear models but was inferior to ensemble approaches, highlighting the advantage of ensemble learning methods in capturing complex nonlinear relationships inherent in diabetes progression.

To further evaluate how well the model generalizes to unseen data, we compared the training, cross-validation (CV), and test accuracies across all evaluated models (Figure 5). Gradient Boosting emerged as the most robust on unseen data with a test accuracy of 0.981, training score of 0.991 and cross validation score of 0.972. The Gradient Boosting remained stable across the three phases, showing great generalization capabilities without overfitting compared to the XGBoost. The XGBoost model achieved the highest training accuracy of 1.00, a cross-validation score of 0.986 However, the test score accuracy decreased to 0.962, indicating slight overfitting. The Random Forest and the Decision Tree had moderate strong performance, displaying similar generalizability patterns. The Random Forest started with a slightly higher training score than the decision tree (0.981 vs. 0.972) but both converged to the same validation score of 0.962 and final test score of 0.962. The SVM had the sharpest drop in performance as it started with a strong training score of 0.972, resulting in the lowest test accuracy of 0.865. Logistic Regression on the other hand still yielded consistently lower metrics across the three phases, starting at 0.948 in training and finishing at 0.885 on the test set. Support Vector Machine (SVM) and Logistic Regression struggled the most with generalization. Overall, ensemble-based methods demonstrated superior predictive performance and generalization compared to single linear models.

Figure 5.

Line chart comparing accuracy scores of six tuned machine learning models—Random Forest, Logistic Regression, Support Vector Machine, Gradient Boosting, Decision Tree, and XGBoost—across train, cross-validation, and test sets. Gradient Boosting and XGBoost maintain high test accuracy above 0.96, while Logistic Regression and Support Vector Machine exhibit lower test accuracy, at 0.885 and 0.865 respectively. Values are annotated at each point.

A variational accuracy scores of tuned classification models across train, cross-validation, and test diabetes datasets. The line graph illustrates the performance trajectory of the optimized models (each corresponding to a specific color) from training through 10-fold cross-validation with 100 repeats to final testing. Individual data point labels provide precise accuracy coefficients for each validation stage.

The Gradient Boosting, which emerged as the top robust model, was used to construct ROC curves and results are shown in Figure 6. The AUC-ROC represents the model's ability to distinguish between classes across various thresholds. When the AUC value is high it indicates that the model is performing better. Due to the small test set sample size, averaging ROC curves across multiple Stratified Fold splits was done because it aggregates information from all the folds rather than relying on a single limited test set, hence producing a more reliable ROC curve. The results show outstanding classification performance with slight variations between the classes. Class 0 (non-diabetic) had the highest AUC of 0.991, followed by Class 1 (prediabetic) with an AUC of 0.986 and lastly Class 2 (diabetic) with an AUC of 0.972. The diabetic class was comparatively the challenging class for the model to classify as shown by the green solid line sitting lower than the others. Overall, the model was highly effective at distinguishing between the three classes, with all the AUC scores above 0.97.

Figure 6.

ROC curve graph with three colored lines representing Class 0, Class 1, and Class 2, showing high performance with AUC values of 0.991, 0.986, and 0.972 respectively, compared to a diagonal chance line with an AUC of 0.50.

Receiver operating characteristic (ROC) analysis of the optimized gradient boosting classifier using the one-vs-rest (OvR) multiclass strategy. ROC curves were obtained by averaging across stratified cross-validation folds because of the limited independent test-set size. The model achieved AUC values of 0.991 (non-diabetic), 0.986 (prediabetic), and 0.972 (diabetic), with a macro-average AUC of 0.983, demonstrating excellent discrimination across all diabetes stages. Shaded regions surrounding each curve represent the variance across validation folds, dashed diagonal line indicates the baseline for random chance (AUC = 0.50).

To further evaluate the discriminative ability of the optimized Gradient Boosting classifier, multiclass ROC analysis was performed using the one-vs-rest (OvR) strategy. Owing to the relatively small independent test set, ROC curves and AUC values were estimated by averaging predictions across the stratified cross-validation folds. The classifier demonstrated excellent discrimination across all three diabetes classes. The class-specific AUC values were 0.991 for the non-diabetic class, 0.986 for the prediabetic class, and 0.972 for the diabetic class, corresponding to a macro-average AUC of 0.983. These consistently high AUC values indicate that the proposed framework reliably distinguishes between the three stages of diabetes, with only a slight reduction in discrimination for the diabetic class, reflecting the greater overlap between advanced disease stages.

The feature importance analysis in Figure 7 showed that the model's decision-making process is driven by three core clinical indicators, and all the other variables contribute very little. The key predictors are HbA1c, BMI and Age. HbA1c exhibited the highest MDI (exceeding 0.5) and Permutation importance (approximately 0.45) score, indicating that the model relies fundamentally on the patient's HbA1c level to make a classification. The permutation score indicates that removing or shuffling this feature would severely degrade the model's accuracy. The analysis also ran the models without the HbA1c to assess how it impacts the accuracy of the metrics and there was an observed decline in the accuracy across all classifiers, with Random Forest decreasing from 0.962 to 0.906, Logistic Regression from 0.887 to 0.774, Support Vector Machine from 0.926 to 0.717, Gradient Boosting from 0.906 to 0.868, Decision Tree from 0.887 to 0.830, and XGBoost from 1.00 to 0.887 as shown in Figure. 8. These findings underscore the dominant role of HbA1c as a predictive biomarker and highlight its critical contribution to model performance in diabetes classification. BMI and Age were the only other features that offer meaningful predictive value. BMI was the second important feature with moderate influence (MDI∼0.18, Permutation∼0.08). Age ranked third, contributing a smaller but recognizable importance to the model (MDI∼0.09, Permutation∼0.03). This is supported by the correlation heatmap in Figure 9, whereby HbA1c and class had the strongest positive correlation of 0.77, followed by BMI and class with a correlation of 0.75 then age and class with a positive correlation of 0.51. The remaining eight features (Urea, Chol, VLDL, Cr, TG, Gender, LDL, and HDL) showed minimal to no predictive power, all with MDI scores below 0.05 and permutation scores at zero (indicated by lack of the orange bars). Because the Gradient Boosting classifier achieved a test accuracy of 0.981 with AUC values exceeding 0.97, additional analyses were conducted to assess the robustness of these results. The close agreement between the training (0.991), 10-fold cross-validation (0.972), and independent test (0.981) accuracies indicates strong generalization with little evidence of overfitting. Hyperparameter optimization was performed exclusively on the training data using RandomizedSearchCV with 10-fold cross-validation, reducing optimistic bias and minimizing the risk of data leakage. Furthermore, the statistical power analysis demonstrated that the study was adequately powered to detect the observed effects, supporting the reliability of the findings. Feature importance analysis (Figure 7) consistently identified HbA1c, BMI, and age as the dominant predictors, while the remaining variables contributed minimally. This was further confirmed by the HbA1c sensitivity analysis (Figure 8) and SHAP explanations, both of which were consistent with established clinical knowledge. Although the relatively small sample size (n = 264) and the strong discriminatory ability of HbA1c may have contributed to the high predictive performance, the combined evidence from cross-validation, power analysis, feature importance, sensitivity analysis, and SHAP supports that the reported performance reflects genuine predictive capability rather than model overfitting.

Figure 7.

Horizontal bar chart comparing feature importance using MDI Importance and Permutation Importance for twelve features. HbA1c shows highest importance, followed by BMI and AGE. Remaining features have significantly lower values. Legend included.

Feature importance ranking and mean decrease impurity (MDI) analysis. This horizontal bar char evaluates the relative contribution of clinical and biological variables to the machine learning model's predictive performance. HbA1c emerges as the primary predictor by a significant margin in both MDI and Permutation Importance scores, followed by BMI and AGE. The comparison reveals that most other biological features link Urea, Cholesterol and Lipid biomarkers have lower importance, signifying that the model's sensitivity lies heavily on glycemic control and demographic factors like AGE.

Figure 8.

Bar chart comparing accuracy of six machine learning models—Random Forest, Logistic Regression, Support Vector Machine, Gradient Boosting, Decision Tree, XGBoost—with and without HbA1c. Accuracy is consistently higher with HbA1c, reaching a maximum of 1.000 for XGBoost with HbA1c and a minimum of 0.717 for Support Vector Machine without HbA1c.

Sensitivity analysis of HbA1c as a critical predictive feature on model performance. The grouped bar chart illustrates the differential impact on model accuracy when the HbA1c feature is removed from the dataset. A consistent performance decline across all six models, most notably in the Support Vector Machine and Logistic Regression. Where accuracy drops by approximately 0.209 and 0.113, respectively. The sustained accuracy of the XGBoost and Random Forest Models (above 0.88) even after feature removal highlight their robustness.

Figure 9.

Heatmap of a correlation matrix for numerical features with a color scale from blue to red, where blue indicates negative correlation, red indicates positive correlation, and the diagonal shows perfect correlation of one. Axis labels list features such as Gender, AGE, Urea, Cr, HbA1c, Chol, TG, HDL, LDL, VLDL, BMI, and Class, with each cell displaying the correlation coefficient between feature pairs.

Pearson correlation heatmap of clinical and biological features. This matrix visualizes the strength and direction of linear relationships between all numerical variables in the study cohort. Armstrong positive is observed between the Class variable and HbA1c (0.77), BMI (0.75), confirming their roles as significant predictors. Color ranges from blue (negative correlation) to red (positive correlation).

To evaluate the model for potential demographic bias, the performance was analyzed across age and gender. Though the analysis included gender, it is important to note that the focus was placed on age because the feature importance analysis revealed gender to be negligible on the model's performance. The subgroup breakdown by age revealed some performance disparities. Figure 10 shows that the model performed consistently well on older individuals, achieving an accuracy of 0.94, F1 score of 0.92, which is slightly higher than the overall metrics on the whole dataset's test set. Performance on younger individuals was skewed as it achieved a perfect accuracy of 1.00, however the precision, recall and F1 score dropped to 0.67. This imbalance is due to the severe class imbalance and extremely small sample size (n = 5), hence it would make it difficult for the model to reliably generalize for younger patients. These findings suggest that stratified models provide more reliable predictions in well-represented populations, partially supporting the hypothesis that demographic stratification improves model performance.

Figure 10.

Grouped bar charts compare model metrics (accuracy, precision, recall, F1-score) for age groups on the left (<35, ≥35, and overall) and gender on the right (female, male, and overall). Older and male groups have higher scores in all metrics.

Comparative summary of stratified model performance metrics across age and gender subgroups vs. on the Overall dataset. The bar chart provides side by side analysis of performance predictors (Accuracy, Precision, Recall and F1-Score) for age strata vs. the whole data (on the left) and the gender strata vs. the whole dataset (on the right). This shows how effectively the model maintains classification across different subsets of the dataset, in order to determine whether the model's efficacy is uniformly distributed or specific to stratified characteristics.

SHAP analysis was used to interpret the multiclass prediction model in order to identify key clinical factors of the model output across the classes (non-diabetic, prediabetic, diabetic). The SHAP summary plot (Figure 11) shows the overall impact of each feature on predicting the class. HbA1c stood out as the strongest driver for diabetes class classification although the magnitude and direction of influence varied for each diabetes stage. To explain the predictions of the selected Gradient Boosting classifier, the SHAP TreeExplainer was applied, which provides an efficient and theoretically grounded computation of Shapley values for tree-based ensemble models. TreeExplainer was selected because it produces exact or computationally efficient Shapley value estimates while preserving the consistency and local accuracy properties of the SHAP framework.

Figure 11.

Three panels labeled a, b, and c each display SHAP value summary plots and heatmaps comparing the impact of various clinical features, such as HbA1c, BMI, age, and cholesterol, on model outputs. Vertical feature lists are sorted by importance; color bars indicate feature values from low (blue) to high (pink), and the right-side heatmaps illustrate SHAP value distributions across model instances.

Class-specific SHAP summary plots and feature contribution heatmaps for diabetes classification. The plots illustrate feature importance and direction of influence for (a) non-diabetic, (b) prediabetic, and (c) diabetic classes. Color gradients indicate how high and low feature values contribute to class predictions, highlighting stage-specific effects of key predictors such as HbA1c and improving the interpretability of the model.

For the non-diabetic class, summary plots showed that lower levels of HbA1c were strongly associated with positive SHAP values, indicating that lower values pushed the prediction towards the non-diabetic class. Additionally, the plots for the non-diabetic class demonstrated moderate influence with BMI and cholesterol, here higher BMI pushed the prediction away from being non-diabetic. The corresponding heatmaps supported these findings, HbA1c maintained consistent dominant influence across individuals, providing robustness of feature importance.

In the prediabetic class, HbA1c as well as age showed the strongest and most variable SHAP distributions as high values seemed to have bidirectional influence on the prediction, which is expected given the transitional state of the disease at this stage. Age and BMI also had bidirectional contributions to the model's classification. The heatmap confirmed that these features sustained influence across most individual instances even though their impact was more varied than in the non-diabetic population.

Lastly, for the diabetic class, high values of HbA1c produced strong positive contributions to diabetic predictions. BMI and age also showed strong positive contributions to prediction outcomes. Additionally in this class, lipid biomarkers such as Cholesterol also showed some contributions to the prediction, with higher levels pushing the prediction to diabetes class.

Overall, the SHAP summary and heatmap analysis reveal that, especially for HbA1c and BMI, there are strong feature-specific turning points that could be translated into clinically interpretable insights on how individual risk factors drive diabetes classification across different stages. This supports the potential use for personalized risk stratification and early intervention. Global SHAP analysis demonstrated that HbA1c, BMI, and age were the most influential predictors across the multiclass model, whereas local SHAP force plots provided patient-specific explanations by quantifying the contribution of individual clinical variables to each prediction. Together, these complementary visualizations explain both the overall behavior of the model and the rationale behind individual clinical decisions.

Although Figure 11 gives us a global view of what features matter across the whole population, Figure 12 takes a step further and shows how the features play out for six real individuals. Six representative patients were selected across the three disease classes and age groups for SHAP force plot analysis. These visualizations show which specific clinical features contribute to the final classification in relation to the model's base value. In each case, features shown in red push the prediction toward the predicted class, while features in blue push the prediction away from it. The final model output f(x) reflects the combined effect of all feature contributions, with higher values indicating stronger support for the predicted class.

Figure 12.

Five horizontal SHAP force plot graphics depict the contribution of various health parameters to diabetes risk across different patient scenarios by age and diabetic status, each labeled as a separate case. Color-coded bars (red for higher risk, blue for lower risk) illustrate feature contributions such as age, BMI, cholesterol, and HbA1c. f) notes there are no diabetic patients under thirty-five.

SHAP force plots for individual patients across individual patient cases and Age groups. Panels (A–F) provide a granular visualization of how specific clinical features “push” the model's prediction away from or towards a specific class output for representative individuals.

Case 1: Age <35 | non-diabetic

The model shows high confidence in making this prediction, with a final output f(x) = 0.92. The prediction was pushed towards the non-diabetic class by primarily lower BMI and lower HbA1c. A higher Cholesterol, on the other hand, was the only feature that pulled the prediction lower but it was heavily outweighed by the protective factors (BMI and HbA1c). This case depicts that glycemic control and body composition have a dominant effect in determining this individual's low risk to diabetes.

Case 2: Age 35+ | non-diabetic

Contrary to the younger patient, this patient had a model output f (x) = 1.10, which indicates that the model had lower confidence in classifying case 2 into the non-diabetic class. For this case even though the patient was non-diabetic, they were still flagged for having low renal markers like urea and creatinine. A lower cholesterol acted as a protective factor from diabetes prediction. This case suggests that, in older individuals there are additional clinical biomarkers beyond glycemic control that influence the model's prediction.

Case 3: Age <35 | pre-diabetic

The model predicts prediabetes with a moderate confidence f(x) = 0.72. The key contributing factors that pushed the prediction to the prediabetic class were a lower-than-average HbA1c, Age, BMI and Triglycerides. However, elevated urea and creatinine slightly pushed the prediction away from the prediabetes stage. This case reveals that prediabetes is characterized by more variable feature interactions.

Case 4: Age 35+ | pre-diabetic

The prediction is driven primarily by a lower-than-average HbA1c, Age, urea. Additionally, triglycerides and LDL pushed the prediction to the prediabetic class. The combination of these features reflects early metabolic dysregulation, suggesting that there are higher risk patterns in the older individual compared to the younger prediabetic case.

Case 5: Age 35+ | diabetic

The model confidently classified the individual as diabetic f(x) = 0.71. The factors that drove the predictions to the diabetes class were elevated cholesterol and higher LDL levels, even though their HbA1c was lower than average. Non-regulated triglycerides, urea and creatinine additionally acted as indicators for diabetes for this case. This aligns with clinical patterns where dyslipidemia is seen as a major indicator of diabetes progression.

Case 6: Age <35 | diabetic

There were no individuals under 35 years in the dataset that were classified as diabetic, which limited the ability to evaluate SHAP-based explanations for this subgroup. This further highlights the impact of class imbalance and sample size limitations on subgroup interpretability.

The force plot analysis supports the hypothesis that stratified models are more valuable in model interpretability. The exact same types of values (lower BMI and HbA1c) have opposite impacts based on the patient's age and overall profile (evidenced by case 1 vs. case 2), proving that a “one-size-fits-all” threshold is less effective than a personalized SHAP-based assessment. These findings demonstrate that diabetes risk is caused by complex, non-linear interactions rather than by fixed thresholds, supporting the need to use stratified, explainable ML approaches in order to improve personalized risk assessment.

Discussion

The principal contribution of this study extends beyond identifying the highest-performing machine learning algorithm. Rather, the proposed framework demonstrates that integrating multiclass classification, demographic stratification, and explainable artificial intelligence provides a more comprehensive approach for diabetes risk assessment than prediction accuracy alone. By simultaneously distinguishing non-diabetic, prediabetic, and diabetic individuals while providing transparent explanations of individual predictions, the framework addresses two important requirements for clinical decision support: reliable predictive performance and model interpretability. These findings directly address the study objective of developing an explainable machine learning framework capable of supporting personalized risk stratification across clinically relevant patient subgroups.

This study evaluated whether demographic stratification improves multiclass diabetes classification compared with a universal modelling approach. The results showed that ensemble methods, particularly Gradient Boosting, XGBoost, and Random Forest, were most effective in capturing the complex, nonlinear relationships underlying diabetes progression across the non-diabetic, prediabetic, and diabetic stages. This finding is consistent with previous studies reporting the superior predictive performance of ensemble models over linear and single-tree approaches for diabetes classification (59–62). In contrast, Support Vector Machine and Logistic Regression demonstrated lower performance, suggesting that more flexible modelling approaches are better suited for clinical risk stratification (63).

Age based stratification incited us into model reliability and interpretability. The Gradient Boosting model showed robust performance in the 35 + age group, supported by a larger sample size and complete class representation. The slight reduction in recall for the diabetic class suggests that some advanced cases may still be misclassified, potentially due to overlapping metabolic profiles between late-stage prediabetes and early diabetes (64, 65). In contrast, although perfect accuracy was observed in the <35 age group, the very small sample size and absence of diabetic cases severely limited the interpretability and reliability of these findings. This discrepancy emphasizes that stratification can improve interpretability and contextual relevance, but only when supported by sufficient and representative data (66). Although age stratification was motivated by clinically established screening recommendations, interpretation of the findings in participants younger than 35 years should be made cautiously. In the used dataset, this subgroup contained relatively few observations and no diabetic cases, resulting in class imbalance and unstable performance estimates. Future studies should include larger and more diverse cohorts of younger adults to determine whether age-specific models provide consistent clinical benefit and to validate the robustness of stratified machine learning approaches.

SHAP analysis reinforced the clinical plausibility of the proposed framework by identifying HbA1c, BMI, and age as the most influential predictors, consistent with established clinical evidence (67–71). Although these variables remained dominant across all diabetes stages, their relative influence varied according to disease progression, highlighting the heterogeneous nature of diabetes, particularly during the prediabetic stage where metabolic changes precede overt disease (72). Furthermore, patient-level SHAP force plots demonstrated that individuals with similar outcomes could be classified through different combinations of risk factors, supporting the value of demographic stratification for improving model interpretability and enabling more personalized risk assessment compared with a single universal model.

Moreover, an important consideration is that the dominant importance of HbA1c, BMI, and age should be interpreted within the clinical context of diabetes diagnosis. HbA1c is an established diagnostic biomarker for diabetes, while BMI and age are recognized risk factors incorporated into current screening recommendations (14, 69–71). Therefore, the prominence of these variables is expected and reflects their genuine clinical relevance rather than the discovery of previously unknown predictors. The primary contribution of the proposed framework is not the identification of novel biomarkers, but the demonstration that the model learns clinically coherent relationships and transparently quantifies the relative influence of these predictors across diabetes stages and age subgroups. Furthermore, the SHAP analysis showed that although HbA1c consistently had the greatest influence, its contribution, together with those of BMI and age, varied in both magnitude and direction across disease stages and individual patients. These findings indicate that the framework captures clinically meaningful interactions beyond simple diagnostic thresholds, thereby enhancing interpretability and supporting individualized clinical decision-making through transparent risk stratification (31–35, 67–72).

While age stratification produced differences in predictive performance, its principal contribution lies in improving the interpretability of the model rather than accuracy alone. Interpretability was enhanced because the SHAP analyses demonstrated that the direction and magnitude of feature contributions differed across age-defined subgroups, allowing subgroup-specific clinical reasoning that would not be evident in a single pooled model. For example, although HbA1c remained the dominant predictor in both age groups, the patient-level SHAP force plots showed that comparable prediction outcomes were explained by different combinations of HbA1c, BMI, lipid biomarkers, and renal markers in younger and older individuals. This indicates that age stratification exposes clinically meaningful heterogeneity in disease mechanisms and allows clinicians to understand not only which variables are important but also how their contributions change across demographic groups. Such subgroup-specific explanations strengthen transparency, support personalized risk assessment, and improve clinical trust in model predictions, complementing the predictive performance gains observed in the stratified analyses (31–35, 54–58, 66).

Several limitations should be addressed pertaining to this study. First, the dataset had low representation of individuals under 35 years, resulting in decreased generalizability of the stratified analysis for these underrepresented subgroups. Although oversampling algorithms like SMOTE were considered to address class imbalance and small subgroup sizes, they were not used for this model pipeline to preserve real-world applicability and avoid artificially inflating predictive performance. Since the goal of this project is clinical translation, reliance on synthesized samples limits external validity (73–75). Second, while SHAP values improve model interpretability, they only reflect the model's learnt associations, not causal correlations. Thirdly, while this study used clinical and laboratory variables, the progression of diabetes is also impacted by lifestyle factors like diet and physical exercise. Future studies should incorporate these lifestyle factors into predictive models to enhance predictive depth. Expanding the dataset, integrating longitudinal follow-up data and doing external validation on an independent dataset would test the model's reproducibility and further support clinical adoption. Additionally, integration with electronic health records systems and clinical trials would help in determining the practical implementation for early diabetes prediction and patient outcomes in a real-world clinical setting.

Although the present study was conducted using a single clinical dataset comprising 264 individuals, several methodological strategies were implemented to enhance the reliability of the reported findings. Model development incorporated RandomizedSearchCV with repeated 10-fold cross-validation, followed by independent testing on a held-out dataset. The close agreement between the training (0.991), cross-validation (0.972), and test (0.981) accuracies obtained by the Gradient Boosting classifier indicates stable generalization with minimal evidence of overfitting. Furthermore, the ratio between the study sample size and the relatively small number of predictor variables satisfies commonly accepted recommendations for predictive model development, suggesting adequate statistical power for internal model evaluation. These findings are consistent with recommendations that rigorous internal validation provides reliable estimates of predictive performance prior to external validation (76, 77). Nevertheless, internal validation cannot replace independent external or prospective clinical validation. Therefore, the proposed framework should be considered a robust proof-of-concept for explainable diabetes risk stratification that requires evaluation across geographically and clinically diverse populations before routine clinical implementation.

Currently clinical screening approaches rely on universal diagnostic threshold, which often fail in capturing individual variability across demographic subgroups such as age and sex (8, 49). From a public health lens, this limitation reduces the effectiveness of early detection strategies as it may result in patients being misdiagnosed further causing unnecessary treatment or delayed diagnosis. To address this issue, it is very important to consider the diverse risk factors and how they would vary in different populations when developing screening programs (78). This study proposed and found that stratified models produced interpretable results and distinguished between risk factors that vary from individual to individual.

Despite the demonstrated strong predictive performance of ML models, there is still an increasing need for clinically interpretable and transparent decision-support tools that can be adopted into healthcare's routine practices (31). This study therefore proposes a stratified and explainable machine learning framework for diabetes classification. The integration of SHAP-based explanations enables transparent identification of key risk factors, such as HbA1c, BMI, and age, at both the population and individual levels. Hence, by presenting these sub-group specific metabolic patterns, clinicians would be able to provide accurate predictions with clear patient-specific explanations to patients when they inquire about what mainly made them susceptible to diabetes.

Moreover, although ML approaches support earlier and more precise risk assessment, there is still a limited translation into healthcare workflow. Hence, integration such a model pipeline into an electronic health record system could allow for proactive risk identification, targeted preventive counselling and earlier referral to lifestyle or metabolic intervention programs. Consequently, the generalizability of the model to different healthcare settings, patient populations, and geographic regions remains to be established. External validation using independent cohorts is an essential next step to assess the robustness, calibration, and transportability of the proposed framework under real-world clinical conditions. Future studies should therefore evaluate the framework on multi-center and ethnically diverse datasets before routine clinical implementation. Overall, this study contributes to the development of equitable, data-driven public health strategies by demonstrating that demographic-aware and explainable machine learning models can enhance early detection, support personalized care, and ultimately improve population-level diabetes outcomes.

Conclusion

This study demonstrates that stratifying machine learning models by demographic factors, particularly age, revealed heterogenous feature influence patterns, supporting the hypothesis that demographic aware model frameworks enhance clinical interpretability. Ensemble models such as Gradient Boosting, XGBoost and Random Forest achieved high predictive performance, while explainable AI techniques revealed biologically and clinically meaningful feature contributions across disease stages. The results show that diabetes risk is not driven by a single biomarker but emerges from complex, stage-specific interactions between glycemic control, body composition, age, and lipid metabolism. The SHAP analyses demonstrated that the contribution and influence of key predictors, particularly HbA1c, BMI, and age, varied across age groups and diabetes stages, enabling more clinically meaningful explanations and personalized risk assessment. Thus, the proposed framework combines robust predictive performance with transparent, subgroup-specific decision support for diabetes screening and management. While stratification improved insight into subgroup-specific risk patterns, its effectiveness was contingent on adequate sample size and class representation, underscoring the importance of balanced datasets in future work. Overall, these findings support the integration of stratified, interpretable machine learning models into clinical decision support systems to facilitate early detection, personalized intervention, and improved management of diabetes progression.

Acknowledgments

Authors are thankful to the reviewers for wonderful comments which helps to improvise the paper. Authors also acknowledge the ASU for the writing and editing supports. This article was submitted as a preprint to medRxiv as o Lukhele et al. (79).

Funding Statement

The author(s) declared that financial support was received for this work and/or its publication. This work is partially supported by ASU Grant PD01500 and ASU BDS graduate Program.

Footnotes

Edited by: Tadese Melaku Abegaz, The University of Texas at El Paso, United States

Reviewed by: Jayakumar Kaliappan, Vellore Institute of Technology (VIT), India

Doreen Sim, School of Media, Languages & Cultures, University of Nottingham Malaysia, Malaysia

Data availability statement

Publicly available datasets were analyzed in this study. This data can be found here: https://data.mendeley.com/datasets/wj9rwkp9c2/1.

Ethics statement

Written informed consent was obtained from the individual(s) for the publication of any potentially identifiable images or data included in this article.

Author contributions

NL: Writing – review & editing, Writing – original draft, Investigation, Data curation, Formal analysis, Software, Visualization, Methodology. FM: Data curation, Project administration, Formal analysis, Visualization, Validation, Methodology, Conceptualization, Writing – original draft, Supervision, Funding acquisition, Writing – review & editing, Resources, Investigation, Software.

Conflict of interest

The author(s) declared that this work was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Generative AI statement

The author(s) declared that generative AI was not used in the creation of this manuscript.

Any alternative text (alt text) provided alongside figures in this article has been generated by Frontiers with the support of artificial intelligence and reasonable efforts have been made to ensure accuracy, including review by the authors wherever possible. If you identify any issues, please contact us.

Publisher's note

All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.

References

  • 1.Sacks DB, Arnold M, Bakris GL, Bruns DE, Horvath AR, Lernmark Å, et al. Guidelines and recommendations for laboratory analysis in the diagnosis and management of diabetes mellitus. Clin Chem. (2023) 69(8):808–68. 10.1093/clinchem/hvad080 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 2.Saeedi P, Petersohn I, Salpea P, Malanda B, Karuranga S, Unwin N, et al. Global and regional diabetes prevalence estimates for 2019 and projections for 2030 and 2045: results from the international diabetes federation diabetes atlas. Diabetes Res Clin Pract. (2019) 157:107843. 10.1016/j.diabres.2019.107843 [DOI] [PubMed] [Google Scholar]
  • 3.Olorunfemi BO, Ogunde AO, Almogren A, Adeniyi AE, Ajagbe SA, Bharany S, et al. Efficient diagnosis of diabetes mellitus using an improved ensemble method. Sci Rep. (2025) 15(1):3235. 10.1038/s41598-025-87767-1 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 4.Koban MS, Koban C. (2024). Diabetes diagnosis using machine learning. In: Kumar A, Ghinea G, Merugu S, editors. International Conference on Cognitive and Intelligent Computing (pp. 373–9). Singapore: Springer Nature Singapore. [Google Scholar]
  • 5.Wu W, Peng Z, Chen M, Yu Y, Wu C, Xie Q. Integrating machine learning and bioinformatics approaches to identify novel diagnostic gene biomarkers for diabetic mice. Sci Rep. (2025) 15(1):23043. 10.1038/s41598-025-96192-3 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6.Xu Z, Zhou Y, Xie R, Ning Z. Metabolomics uncovers the diabetes metabolic network: from pathophysiological mechanisms to clinical applications. Front Endocrinol. (2025) 16:1624878. 10.3389/fendo.2025.1624878 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.Yadav A, Gourisaria MK, Dwivedi N, Bandyopadhyay A, Singh JP, Mishra SR. (2024). Uncovering the Impact of Untreated Diabetes via Machine Learning Approach. In 2024 International Conference on Intelligent Algorithms for Computational Intelligence Systems (IACIS) (pp. 1–7). Hassan: IEEE. [Google Scholar]
  • 8.Talaschian M, Asgari S, Tohidi M, Azizi F, Etemad K, Hadaegh F, et al. Validity of hemoglobin A1C for screening prediabetes and diabetes in the Iranian population: analysis of national surveillance data. Sci Rep. (2026) 16(1):1093. 10.1038/s41598-025-00792-y [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.Shabestari M, Mehrabbeik A, Barbieri S, Marques-Vidal P, Heshmati-Nasab P, Azizi R. Predictive factors of hypoglycemia in type 2 diabetes: a prospective study using machine learning. Sci Rep. (2025) 15(1):18143. 10.1038/s41598-025-03030-7 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.Kiran M, Xie Y, Anjum N, Ball G, Pierscionek B, Russell D. Machine learning and artificial intelligence in type 2 diabetes prediction: a comprehensive 33-year bibliometric and literature analysis. Front Digit Health. (2025) 7:1557467. 10.3389/fdgth.2025.1557467 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 11.Rafie Z, Talab MS, Koor BEZ, Garavand A, Salehnasab C, Ghaderzadeh M. Leveraging XGBoost and explainable AI for accurate prediction of type 2 diabetes. BMC Public Health. (2025) 25(1):3688. 10.1186/s12889-025-24953-w [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12.Zhao M, Yao Z, Zhang Y, Ma L, Pang W, Ma S, et al. Predictive value of machine learning for the progression of gestational diabetes mellitus to type 2 diabetes: a systematic review and meta-analysis. BMC Med Inform Decis Mak. (2025) 25(1):18. 10.1186/s12911-024-02848-x [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13.Aragão MV, Afonso AG, Ferraz RC, Ferreira RG, Leite SG, De Figueiredo FA, et al. A practical evaluation of AutoML tools for binary, multiclass, and multilabel classification. Sci Rep. (2025) 15(1):17682. 10.1038/s41598-025-02149-x [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Fang M, Wang D, Echouffo-Tcheugui JB, Selvin E. Prediabetes and diabetes screening eligibility and detection in US adults after changes to US preventive services task force and American diabetes association recommendations. JAMA. (2022) 327(19):1924–5. 10.1001/jama.2022.5185 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 15.Petridis PD, Kristo AS, Sikalidis AK, Kitsas IK. A review on trending machine learning techniques for type 2 diabetes Mellitus management. Informatics. (2024) 11(4):70. 10.3390/informatics11040070 [DOI] [Google Scholar]
  • 16.Wen Y, Wan Z, Ren H, Wang X, Wang W. Interpretable machine learning model for predicting and assessing the risk of diabetic nephropathy: prediction model study. JMIR Med Inform. (2025) 13:e64979. 10.3390/informatics11040070 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17.Petridis PD, Kristo AS, Sikalidis AK, Kitsas IK. Advances in artificial intelligence for diabetes prediction: insights from a systematic literature review. Artif Intell Med. (2025) 103132:70. 10.2196/64979 [DOI] [PubMed] [Google Scholar]
  • 18.Wen Y, Wan Z, Ren H, Wang X, Wang W. An Overview of Machine Learning Classification Techniques. In BIO Web of Conferences. (2024) 97: p. 00133–e64979. Najaf: EDP Sciences. 10.1016/j.artmed.2025.103132 [DOI] [Google Scholar]
  • 19.Islam R, Sultana A, Islam MR. A comprehensive review for chronic disease prediction using machine learning algorithms. J Electr Sys Inf Technol. (2024) 11(1):27. [Google Scholar]
  • 20.Afsaneh E, Sharifdini A, Ghazzaghi H, Ghobadi MZ. Recent applications of machine learning and deep learning models in the prediction, diagnosis, and management of diabetes: a comprehensive review. Diabetol Metab Syndr. (2022) 14(1):196. 10.1186/s43067-024-00150-4 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 21.Abd Aziz NA, Ali AM, Nor Azamen NTN, Osman R. Multiclass prediction of diabetic retinopathy severity using machine learning algorithms. Malays J Med Health Sci. (2024) 20. 10.1186/s13098-022-00969-9 [DOI] [Google Scholar]
  • 22.Ghosh S, Halder S, Maity P, Munshi S. A machine learning approach for multiclass classification of diabetes. Int J Eng Inf Manag. (2025) 1(1):73–92. [Google Scholar]
  • 23.Ashisha GR, Mary XA, Chowdhury S, Karthik C, Choudhury T, Kotecha K. (2023). Early detection of diabetes using ML based classification algorithms. In: Garg D, Rodrigues JJPC, Gupta SK, Cheng X, Sarao P, Patel GS, editors. International Advanced Computing Conference (pp. 148–57). Cham: Springer Nature Switzerland. 10.52756/ijeim.2025.v01.i01.006 [DOI] [Google Scholar]
  • 24.Metwally AA, Perelman D, Park H, Wu Y, Jha A, Sharp S, et al. Prediction of metabolic subphenotypes of type 2 diabetes via continuous glucose monitoring and machine learning. Nat Biomed Eng. (2024) 01:1–18. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 25.Zargoush M, Ghazalbash S, Hosseini MM, Alemi F, Perri D. Machine learning driven diabetes care using predictive-prescriptive analytics for personalized medication prescription. Sci Rep. (2025) 15(1):26811. 10.1038/s41551-024-01311-6 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 26.Kawale SR, Kallappagol P. (2024) 9. Investigating contemporary research and techniques for early-stage diabetes risk prediction: a comprehensive review. In: Koganti KK, Sreenivasa Rao E, Gupta N, editors. EAI International Conference on Advanced Technologies in Electronics, Communications and Signal Processing (pp. 380–9). Cham: Springer Nature Switzerland. 10.1038/s41598-025-12310-1 [DOI] [Google Scholar]
  • 27.Michelucci U. (2024) 15. Feature importance and selection. In: Michelucci U, editor. Fundamental Mathematical Concepts for Machine Learning in Science (pp. 229–42). Cham: Springer International Publishing. [Google Scholar]
  • 28.Gürsoy Mİ, Alkan A. Investigation of diabetes data with permutation feature importance based deep learning methods. Karadeniz Fen Bilimleri Dergisi. (2022) 12(2):916–30. [Google Scholar]
  • 29.Cahyani N, Irsyada R. Performance comparison of selectkbest and permutation importance in feature selection for diabetes prediction. Brilliance: Research of Artificial Intelligence. (2025) 5(1):529–41. 10.31466/kfbd.1174591 [DOI] [Google Scholar]
  • 30.Della Corte A, Barbierato E, Gatti A. Deployable machine learning on MIMIC-IV: leakage-safe prediction and calibration for incident diabetes. Electronics (Basel). (2025) 14(22):4415–930. 10.47709/brilliance.v5i1.6507 [DOI] [Google Scholar]
  • 31.Li X, Ding F, Zhang L, Zhao S, Hu Z, Ma Z, et al. Interpretable machine learning method to predict the risk of pre-diabetes using a national-wide cross-sectional data: evidence from CHNS. BMC Public Health. (2025) 25(1):1145–541. 10.3390/electronics14224415 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 32.Netayawijit P, Chansanam W, Sorn-In K. Interpretable Machine Learning Framework for Diabetes Prediction: Integrating SMOTE Balancing with SHAP Explainability for Clinical Decision Support. In Healthcare. (2025) 13(20) p. 2588. Basel: MDPI. 10.1186/s12889-025-22419-7 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 33.Zribi M, Zaier F, Aounallah-Skhiri H. Is explainability the missing link in artificial intelligence-based diabetes prediction? European Journal Public Health. (2025) 35(Supplement_4):ckaf161–1294. [Google Scholar]
  • 34.Barman B, Choudhury HK, Jajodia B. Interpretable machine learning for diabetes risk prediction: a large-scale analysis of Indian national survey data. Discover Public Health. (2025) 22(1):832. 10.1093/eurpub/ckaf161.1294 [DOI] [Google Scholar]
  • 35.Prendin F, Pavan J, Cappon G, Del Favero S, Sparacino G, Facchinetti A. The importance of interpreting machine learning models for blood glucose prediction in diabetes: an analysis using SHAP. Sci Rep. (2023) 13(1):16865. 10.1186/s12982-025-01236-8 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 36.Kaliappan J, Saravana Kumar IJ, Sundaravelan S, Anesh T, Rithik RR, Singh Y, et al. Analyzing classification and feature selection strategies for diabetes prediction across diverse diabetes datasets. Front Artif Intell. (2024) 7:1421751. 10.1038/s41598-023-44155-x [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 37.Prendin F, Pavan J, Cappon G, Del Favero S, Sparacino G, Facchinetti A. Random forest algorithm overview. Babylon J Mach Learn. (2024) 2024:69–79. 10.3389/frai.2024.1421751 [DOI] [Google Scholar]
  • 38.Kaliappan J, Saravana Kumar IJ, Sundaravelan S, Anesh T, Rithik RR, Singh Y, et al. Interpretability of radiomics models is improved when using feature group selection strategies for predicting molecular and clinical targets in clear-cell renal cell carcinoma: insights from the TRACERx renal study. Cancer Imaging. (2023) 23(1):76. 10.58496/BJML/2024/007 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 39.Ekong A, Attih I, James G, Edet U. Effective classification of diabetes mellitus using support vector machine algorithm. Res J Sci Technol. (2024) 4(2):18–34. 10.1186/s40644-023-00594-3 [DOI] [Google Scholar]
  • 40.Orton MR, Hann E, Doran SJ, Shepherd STC, Ap Dafydd D, Spencer CE, et al. Prediction of diabetes using logistic regression and ensemble techniques. Computer Methods and Programs in Biomedicine Update. (2021) 1:100032. [Google Scholar]
  • 41.Gündoğdu S. Efficient prediction of early-stage diabetes using XGBoost classifier with random forest feature selection technique. Multimedia Tools Applications. (2023) 82(22):34163–81. 10.1016/j.cmpbup.2021.100032 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 42.Datta P, Das P, Kumar A. Hyper parameter tuning based gradient boosting algorithm for detection of diabetic retinopathy: an analytical review. Bull Electr Eng Inform. (2022) 11(2):814–24. 10.11591/eei.v11i2.3559 [DOI] [Google Scholar]
  • 43.Sahid A, Ul Hoque Babar M, Uddin MP. Multiclass diabetes dataset. Mendeley Data. (2024) V1:34163–81. [Google Scholar]
  • 44.Rashid A. Diabetes dataset. Mendeley Data. (2020) V1. 10.17632/wj9rwkp9c2.1 [DOI] [Google Scholar]
  • 45.Li Q, Zhou J. A comparative analysis of extreme gradient boosting, decision tree, support vector machines, and random forest algorithm in data analysis of college Students' Psychological health. Informatica. (2025) 49(15). [Google Scholar]
  • 46.Gao J, Ren J, Wen Z. (2025). Research on Diabetes Prediction Based on the Randomized Search CV Method. In 2025 2nd International Conference on Electronic Engineering and Information Systems (EEISS) (pp. 1–4). Nanjing: IEEE. 10.31449/inf.v49i15.7004 [DOI] [Google Scholar]
  • 47.Cappelli F, Castronuovo G, Grimaldi S, Telesca V. Random forest and feature importance measures for discriminating the most influential environmental factors in predicting cardiovascular and respiratory diseases. Int J Environ Res Public Health. (2024) 21(7):867. 10.3390/ijerph21070867 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 48.Davidson KW, Barry MJ, Mangione CM, Cabana M, Caughey AB, Davis EM. US Preventive services task force. Screening for Prediabetes and Type 2 Diabetes: US Preventive Services Task Force Recommendation Statement. Jama. (2021) 326(8):736–43. 10.3390/ijerph21070867 [DOI] [Google Scholar]
  • 49.O'Brien MJ, Zhang Y, Bailey SC, Khan SS, Ackermann RT, Ali MK, et al. Screening for prediabetes and diabetes: clinical performance and implications for health equity. Am J Prev Med. (2023) 64(6):814–23. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 50.US Preventive Services Task Force, Davidson KW, Barry MJ, Mangione CM, Cabana M, Caughey AB, Wong JB. Screening for prediabetes and type 2 diabetes: uS preventive services task force recommendation statement. Jama. (2021) 326(8):736–43. 10.1016/j.amepre.2023.01.007 [DOI] [PubMed] [Google Scholar]
  • 51.O'Brien MJ, Zhang Y, Bailey SC, Khan SS, Ackermann RT, Ali MK, et al. Prediabetes and diabetes screening eligibility and detection in US adults after changes to US preventive services task force and American diabetes association recommendations. JAMA. (2022) 327(19):1924–5. 10.1001/jama.2021.12531 [DOI] [Google Scholar]
  • 52.Davidson KW, Barry MJ, Mangione CM, Cabana M, Caughey AB, Davis EM, et al. Screening for prediabetes and type 2 diabetes. Am J Prev Med. (2023) 64(6):814–23. 10.1001/jama.2022.5185 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 53.Nguyen HTT, Cao HQ, Nguyen KVT, Pham NDK. Evaluation of explainable artificial intelligence: shap, lime, and cam. In Proceedings of the FPT AI Conference. (2021) 327:1–6. [Google Scholar]
  • 54.O'Brien MJ, Zhang Y, Bailey SC, Khan SS, Ackermann RT, Ali MK, et al. A review of explainable artificial intelligence from the perspectives of challenges and opportunities. Algorithms. (2025) 18(9):556–823. [Google Scholar]
  • 55.Paliwal G, Kumar A, Sharma KP, Bhargava D, Shrimal VM. Transformative impact of explainable artificial intelligence: bridging complexity and trust. Discov Artif Intell. (2025) 5(1):51. 10.3390/a18090556 [DOI] [Google Scholar]
  • 56.Kabir S, Hossain MS, Andersson K. A comparative survey of SHAP and LIME: explaining machine learning models for transparent AI. Int J Innov Res Educ. (2024) 11(6):827–35. 10.1007/s44163-025-00281-1 [DOI] [Google Scholar]
  • 57.Hernandez JI, Van Cranenburgh S, De Bruin M, Stok M, Mouter N. Using XGBoost and SHAP to explain citizens' Differences in policy support for reimposing COVID-19 measures in The Netherlands. Quality Quantity. (2025) 59(1):381–409. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 58.Chinnaraju A. Explainable AI (XAI) for trustworthy and transparent decision-making: a theoretical framework for AI interpretability. World J Adv Eng Technol Sci. (2025) 14(3):170–207. 10.30574/wjaets.2025.14.3.0106 [DOI] [Google Scholar]
  • 59.Hernandez JI, Van Cranenburgh S, De Bruin M, Stok M, Mouter N. Machine learning approaches for predicting diabetes onset: a comparative study of XGBoost, random forest, and traditional models. TechRxiv. (2025) 59:381–409. 10.36227/techrxiv.174317792.24675569/v1 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 60.Mohammed A, Kora R. A comprehensive review on ensemble deep learning: opportunities and challenges. J King Saud Univ Comput Inf Sci. (2023) 35(2):757–74. [Google Scholar]
  • 61.Khurshid MR, Manzoor S, Sadiq T, Hussain L, Khan MS, Dutta AK. Unveiling diabetes onset: optimized XGBoost with Bayesian optimization for enhanced prediction. PLoS One. (2025) 20(1):e0310218. 10.1016/j.jksuci.2023.01.014 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 62.Li W, Peng Y, Peng K. Diabetes prediction model based on GA-XGBoost and stacking ensemble algorithm. PLoS One. (2024) 19(9):e0311222–774. 10.1371/journal.pone.0310218 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 63.Khurshid MR, Manzoor S, Sadiq T, Hussain L, Khan MS, Dutta AK. Machine learning and deep learning approaches for predicting diabetes progression: a comparative analysis. Electronics (Basel). (2025) 14(13):2583. 10.1371/journal.pone.0311222 [DOI] [Google Scholar]
  • 64.Ge J, Han S, Shi M, Harada M, Yu S, Zheng J, et al. Integrative metabolomics of targeted and nontargeted analyses in T2D progression. Diabetes Care. (2026) 49(2):282–91. 10.3390/electronics14132583 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 65.Song J, Wang C, Zhao T, Zhang Y, Xing J, Zhao X, et al. Multi-omics approaches for biomarker discovery and precision diagnosis of prediabetes. Front Endocrinol. (2025) 16:1520436. 10.2337/dc25-1707 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 66.Ge J, Han S, Shi M, Harada M, Yu S, Zheng J, Prehn C, Adamski J, Kastenmüller G, Schlesinger S, Koenig W, Linkohr B, Thorand B, Suhre K, Gieger C, Peters A, Wang-Sattler R, Interpretability from a new lens: Integrating Stratification and Domain knowledge for Biomedical Applications. arXiv preprint arXiv:2303.09322. (2023) 49:282–91. 10.3389/fendo.2025.1520436 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 67.Netayawijit P, Chansanam W, Sorn-In K. (2025). Interpretable Machine Learning Framework for Diabetes Prediction: Integrating SMOTE Balancing with SHAP Explainability for Clinical Decision Support. In Healthcare 13(20):2588. London: MDPI. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 68.Hasan KS. A Basic Trustworthy Machine Learning Framework for Early Diabetes Detection. (2025).
  • 69.Wang Y, Zhang X, Li Y, Gui J, Mei Y, Yang X, et al. Obesity-and lipid-related indices as a predictor of type 2 diabetes in a national cohort study. Frontiers Endocrinology. (2024) 14:1331739. 10.3389/fendo.2023.1331739 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 70.Sadiq IZ, Katsayal BS, Ibrahim B, Ibrahim M, Hassan HA, Ghali UM, 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. Sci Rep. (2025) 15(1):19339. 10.3389/fendo.2023.1331739 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 71.Wang Y, Zhang X, Li Y, Gui J, Mei Y, Yang X, Liu H, Guo L, Li J, Lei Y, Li X, Sun L, Yang L, Yuan T, Wang C, Zhang D, Li J, Liu M, Hua Y, Zhang L. Data-Driven diabetes classification: a machine learning approach to model comparison and feature importance. In: Hariyanto TI, editor. International Conference on Management Science and Engineering Management (pp. 17–29). Singapore: Springer Nature Singapore; (2025) 14. 10.1038/s41598-025-03718-w [DOI] [Google Scholar]
  • 72.Hu S, Ji W, Zhang Y, Zhu W, Sun H, Sun Y. Risk factors for progression to type 2 diabetes in prediabetes: a systematic review and meta-analysis. BMC Public Health. (2025) 25(1):1220. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 73.Gholampour S. Impact of nature of medical data on machine and deep learning for imbalanced datasets: clinical validity of SMOTE is questionable. Mach Learn Knowl Extr. (2024) 6(2):827–41. 10.1186/s12889-025-21404-4 [DOI] [Google Scholar]
  • 74.Hu S, Ji W, Zhang Y, Zhu W, Sun H, Sun Y. Challenges and limitations of synthetic minority oversampling techniques in machine learning. World J Methodol. (2023) 13(5):373. 10.3390/make6020039 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 75.Salmi M, Atif D, Oliva D, Abraham A, Ventura S. Handling imbalanced medical datasets: review of a decade of research. Artif Intell Rev. (2024) 57(10):273–841. 10.5662/wjm.v13.i5.373 [DOI] [Google Scholar]
  • 76.Alkhawaldeh IM, Albalkhi I, Naswhan AJ, (2019) 13. Statistical Models for Prediction. in Clinical Prediction Models: A Practical Approach to Development, Validation, and Updating (pp. 59–93). Cham: Springer International Publishing. 10.1007/s10462-024-10884-2 [DOI] [Google Scholar]
  • 77.Riley RD, Snell KI, Ensor J, Burke DL, Harrell FE, Jr, Moons KG, Collins GS. Minimum sample size for developing a multivariable prediction model: pART II-binary and time-to-event outcomes. Stat Med. (2019) 38(7):1276–96. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 78.Balayla J. Prevalence threshold (ϕe) and the geometry of screening curves. PLoS ONE 15(10):e0240215. 10.1371/journal.pone.0240215 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 79.Lukhele N. (2026). Development of explainable machine learning framework for early detection and risk stratification of diabetes in age specific variations. medRxiv [Preprint]. Available online at: 10.64898/2026.04.25.26351733 (Accessed April 27, 2026). [DOI] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

Publicly available datasets were analyzed in this study. This data can be found here: https://data.mendeley.com/datasets/wj9rwkp9c2/1.


Articles from Frontiers in Digital Health are provided here courtesy of Frontiers Media SA

RESOURCES