Cross-sectional non-laboratory risk stratification for type 2 diabetes: a comparative evaluation of 18 algorithms using NHANES data

Wait 5 sec.

IntroductionDiabetes mellitus is a major global public health burden affecting hundreds of millions of people worldwide1. Recent estimates indicate that approximately 37.3 million Americans (11.3% of the population) live with diabetes mellitus (DM), most of whom have type 2 diabetes mellitus (T2DM)2. Untreated T2DM is associated with serious microvascular and macrovascular complications, including cardiovascular disease, peripheral arterial disease, nephropathy, and diabetic retinopathy, which can impair quality of life and impose substantial socioeconomic burdens3.Previous mechanistic research has revealed the multifactorial pathogenesis of T2DM, primarily driven by peripheral insulin resistance and progressive pancreatic β-cell dysfunction and further aggravated by chronic low-grade systemic inflammation4,5. Accumulated epidemiological evidence also confirms that modifiable lifestyle and anthropometric indicators such as elevated BMI, sedentary behavior, smoking, excessive alcohol intake, and unhealthy dietary patterns strongly correlate with T2DM development6,7,8,9. Because T2DM may remain asymptomatic for years, timely identification of undiagnosed cases is important. Nevertheless, laboratory-based testing can be difficult to scale for community case-finding. Standard T2DM confirmation relies on laboratory tests based on venous blood samples, including fasting plasma glucose (FPG), glycated hemoglobin (HbA1c), and the 2-hour oral glucose tolerance test (OGTT), all of which require specialized testing facilities and blood collection procedures10,11. As Villena Gonzales et al.10 highlighted, routine blood glucose testing can involve painful blood collection, take considerable time, and impose ongoing financial burdens on individuals and healthcare systems. The global diabetes epidemic exacerbates this practical limitation. According to the 10th edition of the IDF Diabetes Atlas, the global prevalence of diabetes reached 10.5% (536.6 million people) in 2021, with a projected rise to 12.2% (783.2 million) by 2045, accompanied by related medical expenditures of USD 966 billion11. The number of people who may have undiagnosed T2DM underscores the need for scalable, noninvasive tools that can prioritize individuals for definitive laboratory assessment.To complement laboratory-based testing pathways, machine-learning (ML) methods have been used to build models that discriminate diabetes status using readily available, noninvasive population-level indicators. As summarized by Tuppad and Patil12, T2DM’s multifactorial etiology—encompassing unmodifiable demographic traits and modifiable lifestyle and anthropometric exposures—makes it well suited to data-driven discriminative modeling. Kavakiotis et al.13 reviewed ML and data mining applications in diabetes research published before 2016, confirming that supervised algorithms, including logistic regression, support vector machines (SVM), and decision trees, dominate relevant analytical pipelines. Uddin et al.14 systematically compared supervised learning algorithms across 48 diabetes-related studies, noting that SVM was the most frequently used method (adopted in 29 papers), followed by Naïve Bayes (23 papers); random forest yielded the highest accuracy in 53% of the 17 studies in which it was evaluated. More recently, Riveros Perez and Avella-Molano15 used NHANES 2007–2018 data (N = 29,509) to benchmark five algorithms for cross-sectional T2DM discrimination based on lifestyle covariates. Separately, Lee et al.16 constructed ensemble models to predict five-year incident T2DM using longitudinal cohorts from Korea, Japan, and the United Kingdom.Despite these valuable efforts, existing analytical frameworks have two key limitations that restrict the evidence available for population-level undiagnosed T2DM case-finding:(1) Restricted algorithm coverage and unoptimized classification thresholds: Many comparative analyses evaluate only a narrow set of ML models without systematic threshold tuning, leading to imbalanced sensitivity and specificity and hindering the reliable identification of individuals with undiagnosed T2DM. A comprehensive comparison spanning linear baseline models, tree-based boosting architectures, and ensemble neural networks, paired with threshold optimization for balanced case detection, remains uncommon15,16.(2) Limited incorporation of complex survey sampling weights: Prior NHANES-based diabetes models have not always incorporated official survey weights in both model fitting and evaluation. Omitting these weights can compromise population-representative estimates15.To address the above research gaps, this cross-sectional study compared 18 algorithms using 11 non-laboratory predictors in two NHANES cohorts: all eligible adults and adults without prior diabetes diagnosis or current glucose-lowering treatment. The objectives were to identify the most suitable modeling approach for non-laboratory risk stratification and to assess whether greater model complexity offered meaningful additional discriminative value.MethodsData source and study populationThis study used data from the National Health and Nutrition Examination Survey (NHANES), conducted by the National Center for Health Statistics (NCHS). NHANES uses a complex multistage probability sampling design to generate a nationally representative sample of non-institutionalized civilian residents in the United States. We combined seven consecutive two-year survey cycles covering 2005–2006 through 2017–2018. Four core datasets were extracted from each cycle: the Demographic File (DEMO), including age, sex, race/ethnicity, and sampling weights; the Body Measures File (BMX), containing height, weight, and multiple circumference measurements; the Glycohemoglobin File (GHB), containing laboratory HbA1c test results; and the Diabetes Questionnaire File (DIQ), containing self-reported diabetes diagnosis and treatment information. Definitions and analytic procedures for data linkage, survey design, eligibility, outcomes, and predictors are provided in Supplementary Table 1.Eligible participants were required to (1) be aged 20 years or older; (2) have a valid examination weight (WTMEC2YR > 0); and (3) have a nonmissing HbA1c value. Pregnant women were excluded because of physiological changes in glucose metabolism during gestation.Prevalent T2DM was defined as an HbA1c level of at least 6.5% (LBXGH ≥ 6.5), a self-reported diagnosis of diabetes by a health professional (DIQ010 = 1), or current insulin use (DIQ050 = 1).Probable type 1 diabetes was defined as current insulin use (DIQ050 = 1), no current use of oral glucose-lowering medication (DIQ070 = 2), and a reported age at diagnosis of 30 years or younger (DID040 ≤ 30). This pragmatic criterion, informed by a published survey algorithm17, excluded 148 participants, leaving 35,453 in the prevalent cohort.LBXGH, DIQ010, DIQ050, DIQ070, and DID040 were used only for eligibility or outcome construction and were not included in the predictor matrix. Thus, no laboratory, diagnosis, or glucose-lowering treatment variable used to define either cohort was available to the models.After constructing the samples and defining the outcomes, we performed feature engineering and preprocessing.Predictors, derived measures, and missing dataThe 11 predictors were prespecified based on clinical availability and data-leakage constraints: age (RIDAGEYR), sex (RIAGENDR), race/ethnicity (RIDRETH1), adult education (DMDEDUC2), marital status (DMDMARTL), family income-to-poverty ratio (INDFMPIR), waist circumference (BMXWAIST), arm circumference (BMXARMC), body mass index (BMI), waist-to-height ratio (WHtR), and body surface area (BSA).NHANES reserved responses were recoded as missing before cohort construction or modeling. Predictor missingness was summarized before imputation (Supplementary Table 2). A complete-case sensitivity analysis was used to evaluate the primary missing-data strategy.All preprocessing parameters were fitted exclusively using each cohort’s training subset and then applied unchanged to the validation and test data. Continuous predictors were median-imputed and standardized. Missing categorical values were assigned a sentinel value of − 1 and then one-hot encoded, with unknown levels ignored.Four diagnostics were performed within the prevalent-cohort training subset: weighted univariate AUC, selection frequency in subsamples for L1-penalized logistic regression, random forest permutation importance, and unweighted recursive feature elimination rank. For the LASSO diagnostic, survey weights were normalized to a mean of 1 within each fit; the saga solver used a maximum of 3,000 iterations and a tolerance of 10− 4. C was selected from 0.001, 0.003, 0.01, 0.03, 0.1, 0.3, and 1.0 using five-fold stratified weighted-AUC cross-validation and the one-standard-error rule. With C = 0.01, selection frequency was estimated from 200 stratified 60% subsamples drawn without replacement. Complete implementation details and results are provided in Supplementary Tables 3–4 and Supplementary Fig. 1.A base predictor was counted as selected when any corresponding encoded coefficient had an absolute magnitude greater than 10− 8. These diagnostics were descriptive and did not determine predictor inclusion.NHANES survey design and sampling weight processingFor the pooled analysis, the two-year MEC examination weight was divided by seven. To prevent identically numbered strata in different survey cycles from being treated as the same stratum, each SDMVSTRA value was prefixed with its survey cycle. The adjusted examination weight was used to fit estimators that accepted survey weights and to calculate all validation and test metrics.SDMVSTRA, SDMVPSU, and the adjusted examination weight were retained for weighted estimation and variance calculations but were excluded from the predictor matrix.Dataset partitioningEach cohort was first split into a 75% development sample and a 25% held-out test sample, with stratification by outcome. The development sample was then split 80:20 into training and internal validation subsets, yielding 60% training, 15% validation, and 25% testing overall. The prevalent cohort included 21,271 participants in the training subset, 5,318 in the validation subset, and 8,864 in the test subset; the undiagnosed cohort included 18,356 participants in the training subset, 4,589 in the validation subset, and 7,649 in the test subset. All preprocessing was fitted using only the training subset. Numerical imputation medians, categorical missing-value replacement, standardization parameters, and one-hot category levels were learned from the training data and applied unchanged to the validation and test data. Weighted validation AUC and validation-derived Youden thresholds were computed before the operational model was locked. The held-out test set was not used for preprocessing, model selection, threshold selection, or hyperparameter tuning.Candidate models and prespecified model selectionEighteen pipelines were compared: logistic regression; decision tree; random forest; extremely randomized trees; gradient boosting; AdaBoost; linear support vector machine (SVM); random-Fourier-feature RBF SVM approximation; Gaussian naive Bayes; linear discriminant analysis; k-nearest neighbors; multilayer perceptron; XGBoost; LightGBM; CatBoost; soft voting; stacking; and bagging. Hyperparameters and the estimator-specific use of survey weights are reported in Supplementary Table 5.For each model, the weighted validation AUC and a threshold based on the Youden index were estimated in the validation subset. Before any test-set evaluation, an operational model was locked using a prespecified parsimony rule: logistic regression was selected when its validation AUC was no more than 0.010 below the validation leader; otherwise, the validation leader was selected. The selected model’s validation threshold was then applied unchanged to the test subset. Validation rankings and locked thresholds are provided in Supplementary Table 6.Survey weights were supplied during fitting to the estimators identified in Supplementary Table 5; all validation and test metrics were survey weighted. Analyses were conducted in Python using pandas, NumPy, scikit-learn, XGBoost, LightGBM, CatBoost, and SHAP. A random seed of 2024 was used.Performance, uncertainty, calibration, and interpretabilityHeld-out test performance was assessed using survey-weighted AUC, accuracy, sensitivity, specificity, positive predictive value (PPV), and negative predictive value (NPV). Raw confusion counts, survey-weighted counts, and survey-weighted counts per 1,000 participants were calculated at the locked operating point.95% confidence intervals were estimated from 1,000 bootstrap samples by resampling primary sampling units with replacement within each cycle-nested stratum. These intervals quantify test-sample uncertainty conditional on the fitted model and locked threshold. For the operational model, calibration was summarized by the survey-weighted Brier score, calibration slope, calibration intercept, and ten-bin calibration curves. Decision-curve net benefit was evaluated over threshold probabilities ranging from 0.01 to 0.50 in increments of 0.01. Mean absolute SHAP values were calculated using the encoded test data to summarize the magnitude of feature contributions, not their causal direction. Cohort-specific numerical tables and plots are cited alongside the corresponding results.The primary analysis used the imputation pipeline fitted on the training data. The complete-case sensitivity analysis retained only participants without missing values for any of the 11 predictors, used the same fixed training/validation/test partitions, re-estimated the validation threshold, and evaluated logistic regression with the same survey-weighted metrics and bootstrap procedure. Results of the sensitivity analysis were not used for primary model selection.ResultsCharacteristics of the study populationAfter eligibility filtering, 35,601 adults remained. Excluding 148 participants who met the probable type 1 diabetes heuristic yielded a prevalent cohort of 35,453 participants. Of these, 5,708 met the prevalent T2DM definition and 29,745 did not; the survey-weighted prevalence was 11.5% (Table 1). The undiagnosed cohort comprised 30,594 participants, of whom 1,012 had HbA1c ≥ 6.5%; the survey-weighted prevalence was 2.19%.Table 1 Baseline characteristics of the prevalent cohort.Full size tablePredictor robustness diagnosticsWithin the prevalent-cohort training subset, the LASSO subsample-selection frequencies were 1.000 for age, family income-to-poverty ratio, waist circumference, WHtR, and race/ethnicity; 0.635 for BMI; 0.025 for arm circumference; and 0.000 for BSA, sex, education, and marital status. Weighted univariate AUCs ranged from 0.5132 for sex to 0.7465 for WHtR. Random forest permutation importance was highest for age (0.0953), WHtR (0.0521), and waist circumference (0.0221). These diagnostics did not prompt any changes to the 11 prespecified inputs. Complete numerical values and LASSO cross-validation results are shown in Supplementary Tables 3 and 4. Supplementary Fig. 1 presents the results of the four training-only predictor robustness diagnostics. BMI, BSA, and WHtR were derived before partition-specific preprocessing; no outcome-defining or postdiagnosis treatment variable was included in the predictor matrix.Validation-based model selection and comparative test discriminationIn the prevalent validation subset, LightGBM had the highest weighted AUC (0.8310), compared with a weighted AUC of 0.8228 for logistic regression, representing a difference of 0.0082. Therefore, logistic regression was selected under the parsimony rule. In the undiagnosed validation subset, logistic regression had the highest weighted AUC (0.8277) and was selected. The locked thresholds for logistic regression were 0.1049 and 0.0169, respectively (Supplementary Table 6). Among the 18 algorithms evaluated in the prevalent-cohort test subset, weighted AUCs ranged from 0.7281 for k-nearest neighbors to 0.8377 for soft voting; logistic regression had an AUC of 0.8355, 0.0022 lower than that of soft voting. Complete performance results for the prevalent-cohort test subset, including design-adjusted 95% confidence intervals, are provided in Supplementary Tables 7, and the corresponding survey-weighted AUC forest plot is shown in Supplementary Fig. 2.In the undiagnosed test cohort, weighted AUCs ranged from 0.5774 to 0.8270. Logistic regression had the highest weighted AUC (0.8270), followed by linear SVM (0.8258) and linear discriminant analysis (0.8207). Complete performance results for the undiagnosed test cohort, including design-adjusted 95% confidence intervals, are provided in Supplementary Tables 8, and the corresponding survey-weighted AUC forest plot is shown in Supplementary Fig. 3.Operational model performanceThe prevalent test subset contained 8,864 participants and had a survey-weighted T2DM prevalence of 11.65%. At the locked threshold, the logistic regression model had an AUC of 0.8355 (95% CI, 0.8247–0.8457), an accuracy of 0.7193 (0.7095–0.7284), a sensitivity of 0.8189 (0.7961–0.8440), a specificity of 0.7061 (0.6953–0.7165), a PPV of 0.2686 (0.2565–0.2816), and an NPV of 0.9673 (0.9626–0.9725). The undiagnosed test subset contained 7,649 participants and had a survey-weighted prevalence of 2.27%; corresponding values were 0.8270 (0.7977–0.8565), 0.6542 (0.6443–0.6639), 0.8339 (0.7704–0.8980), 0.6500 (0.6399–0.6599), 0.0523 (0.0453–0.0594), and 0.9941 (0.9915–0.9965) (Table 2; Fig. 1). At the locked thresholds, false positives and false negatives per 1,000 were 259.66 and 21.09 in the prevalent cohort and 342.04 and 3.76 in the undiagnosed cohort. Raw and survey-weighted confusion matrices are provided in Supplementary Table 9.Table 2 Performance of the validation-selected logistic regression models at locked operating points.Full size tableFor the prevalent-cohort operational model, the Brier score was 0.0868, the calibration slope was 0.9824, and the intercept was − 0.0280; its calibration curve is shown in Supplementary Fig. 4. For the undiagnosed-cohort model, the corresponding values were 0.0213, 0.9973, and 0.0324; its calibration curve is shown in Supplementary Fig. 5. Complete-case analysis retained 7,731 of 8,864 prevalent test participants (87.22%) and 6,666 of 7,649 undiagnosed test participants (87.15%). The complete-case AUCs were 0.8402 (95% CI, 0.8281–0.8518) and 0.8321 (0.8002–0.8625), respectively; complete-case sensitivity, specificity, PPV, NPV, and accuracy results are reported in Supplementary Table 10.Fig. 1Full size imageSurvey-weighted ROC curves for the logistic regression models.In decision-curve analyses, net benefit in the prevalent cohort exceeded both reference strategies at threshold probabilities of 0.01–0.42 and was negative at thresholds of 0.43–0.50 (Supplementary Fig. 6). In the undiagnosed cohort, net benefit consistently exceeded both reference strategies at thresholds of 0.01–0.13; at thresholds of 0.14–0.50, values remained close to the treat-none reference, ranging from − 0.00050 to 0.000035 (Supplementary Fig. 7).SHAP magnitudesIn the prevalent cohort, the three largest mean absolute SHAP values among encoded features corresponded to age (0.9146), WHtR (0.7373), and the non-Hispanic White race/ethnicity indicator (0.4354) (Supplementary Table 11). In the undiagnosed cohort, the three largest values corresponded to age (0.6958), the non-Hispanic White indicator (0.5761), and the female indicator (0.4894) (Supplementary Table 12). The missing-category indicators for education and marital status had mean absolute SHAP values below 0.0001 in both cohorts.DiscussionKey findingsUsing seven NHANES cycles and 11 prespecified non-laboratory variables, we compared 18 statistical and machine-learning pipelines for two cross-sectional targets: prevalent T2DM among all eligible adults and an elevated HbA1c level consistent with previously unrecognized diabetes among adults without a reported diagnosis or current glucose-lowering treatment. The principal finding was that no complex algorithm was consistently superior. In the prevalent validation subset, LightGBM exceeded logistic regression by only 0.0082 AUC units, so logistic regression met the prespecified parsimony criterion; in the held-out test subset, soft voting had an AUC of 0.8377 and logistic regression had an AUC of 0.8355, a difference of 0.0022. In the undiagnosed cohort, logistic regression ranked first in both the validation and test datasets (AUCs of 0.8277 and 0.8270, respectively). Algorithmic complexity therefore yielded no consistent improvement in discrimination with this predictor set. These results support transparent logistic regression as the operational model under the prespecified selection rule; they do not support the claim that machine learning outperforms conventional regression.At the validation-locked thresholds, logistic regression prioritized sensitivity over specificity. Sensitivity and specificity were 0.8189 and 0.7061 in the prevalent test cohort and 0.8339 and 0.6500 in the undiagnosed test cohort. Because the survey-weighted prevalence in the latter cohort was only 2.27%, its PPV was 0.0523 and approximately 342 false-positive classifications occurred per 1,000 people, despite an NPV of 0.9941 and 3.76 false-negative classifications per 1,000. The high NPV is therefore strongly influenced by the low baseline prevalence and does not mean that a negative model result can exclude T2DM. A below-threshold value should not lead to deferral of laboratory testing when symptoms, clinical risk, or guideline eligibility indicate testing. Likewise, the lower Brier score in the undiagnosed cohort (0.0213 versus 0.0868) should not be interpreted as proof of superior calibration because the Brier score is prevalence-dependent. Calibration slopes and intercepts close to their ideal values are reassuring within these held-out NHANES subsets, but they do not establish calibration in a population with a different case mix or prevalence.The complete-case AUCs (0.8402 in the prevalent cohort and 0.8321 in the undiagnosed cohort) were close to the primary estimates, suggesting that the median/constant imputation strategy was not the main driver of discrimination, although complete-case restriction can itself introduce selection bias. Decision-curve results were also context-dependent: net benefit exceeded both reference strategies only over threshold probabilities of 0.01–0.42 in the prevalent cohort and 0.01–0.13 in the undiagnosed cohort, becoming negative or approximately zero above those ranges. These internal calculations describe possible trade-offs under the assumed thresholds; they do not establish clinical utility. Mean absolute SHAP values further showed that age and central-adiposity measures contributed substantially to the fitted predictions. This pattern is biologically plausible because visceral adiposity is associated with insulin resistance and chronic low-grade inflammation4,5. However, mean absolute SHAP values quantify magnitude, not direction, independence, or causality. Correlation among BMI, waist circumference, WHtR, and BSA can redistribute attribution, and sex and race/ethnicity indicators may encode social, environmental, and structural differences as well as measured demographic variation.Comparison with previous studiesPrior reviews of diabetes modeling have documented wide variation in populations, outcome definitions, predictor availability, validation methods, and reported performance13,14,18,19. Such heterogeneity helps explain why different algorithms appear to perform best across studies and why reported AUCs are not directly comparable. The present benchmark addressed a narrower question: when each algorithm uses the same compact, leakage-controlled set of 11 non-laboratory predictors, does nonlinear complexity add meaningful discrimination beyond logistic regression? Survey weighting, separate validation and test subsets, and validation-locked model and threshold selection strengthened that comparison. Under this protocol, complex models did not show a consistent advantage. This result does not imply that complex algorithms are generally inferior; it indicates that case definition, predictor content, and validation discipline were more consequential than algorithm class in these data.Riveros Perez and Avella-Molano also used NHANES 2007–2018 and compared five algorithms for cross-sectional diabetes classification using lifestyle-related variables15. They reported XGBoost as the leading model (AUC 0.8168); most models combined high specificity with low sensitivity, whereas the support vector machine increased sensitivity at the cost of lower accuracy. The present study yielded a different sensitivity–specificity balance at its validation-selected thresholds, but this difference should not be interpreted as evidence of superiority. Differences in outcome construction, predictor definitions, eligibility criteria, the handling of survey weights, data partitions, and threshold selection can alter both AUC and operating-point metrics. Taken together, the studies illustrate that algorithm ranking alone is insufficient: threshold choice and the resulting referral burden must be reported when the intended use involves case finding.The study by Lee et al. addressed a different estimand: five-year incident T2DM in a Korean development cohort, with external validation in Japanese and UK cohorts16. Its longitudinal design estimates future risk, whereas the present undiagnosed outcome identifies an HbA1c level of at least 6.5% at the same examination among people without a known diagnosis or current treatment. The overlapping AUC ranges across the two studies therefore do not demonstrate equivalent performance. The prediction horizon, outcome ascertainment, available variables, health systems, and baseline risk all differ. Importantly, Lee et al. evaluated geographic transportability, whereas the current study includes only an internal held-out evaluation using the same pooled NHANES source. Accordingly, our results should be described as cross-sectional discrimination, not prediction of future diabetes.NHANES lifestyle-modeling studies and general boosting benchmarks show that tree ensembles can perform competitively when interactions and nonlinearities are informative20,21. In the present undiagnosed cohort, however, logistic regression, linear SVM, and linear discriminant analysis held the top three positions by test AUC, whereas several boosting and ensemble methods ranked lower. A plausible explanation is that a low-dimensional set dominated by age and anthropometric measures contains relatively smooth, approximately monotonic risk gradients, leaving limited incremental signal for complex interactions. Restricting predictors to information available before laboratory assessment may also narrow between-model differences. Nevertheless, fixed model specifications and the absence of formal pairwise AUC comparisons mean that modest gains from alternative tuning or additional valid predictors cannot be excluded. These results indicate that complexity did not consistently improve performance under this study’s protocol; they do not establish that logistic regression is universally superior.Clinical and public health implicationsCurrent recommendations identify A1C or plasma glucose measurements as the basis for diabetes testing and diagnosis, with confirmatory testing when clinically required22,23. Because the present models deliberately omit laboratory variables, they cannot diagnose or exclude T2DM and must not replace guideline-recommended laboratory confirmation. Their most defensible potential role, if supported by prospective external validation, is preliminary non-laboratory risk stratification: a short questionnaire and standardized anthropometry might help prioritize timely laboratory assessment in populations with a high diabetes burden11 and limited access to testing or incomplete care cascades24. Any such use should complement, rather than replace, consideration of symptoms, medical history, clinician judgment, and guideline-based eligibility for testing.The undiagnosed-cohort operating point illustrates the practical trade-off. A threshold of 0.0169 yielded a sensitivity of 0.8339, a specificity of 0.6500, and a PPV of 0.0523, corresponding to about 342 false-positive classifications per 1,000 people. A large confirmatory-testing workload may be acceptable in some high-capacity programs but not in settings where laboratory access is already constrained; anxiety, follow-up burden, and opportunity costs also require consideration. Conversely, the estimated 3.76 false-negative classifications per 1,000 show why a negative classification cannot justify withholding indicated testing. The Youden criterion gives sensitivity and specificity equal statistical weight, but it does not encode program capacity, patient preferences, or the relative harms of missed and unnecessary referrals. Thresholds should therefore be selected for a prespecified workflow after external recalibration, not exported unchanged from NHANES.The prominence of waist circumference and WHtR suggests that standardized measures of central adiposity may be feasible inputs for an initial risk assessment. Consensus statements recognize waist circumference as complementary to BMI for cardiometabolic risk assessment25,26. However, the present SHAP analysis does not prove that waist measures are superior stand-alone case-finding tools or intervention targets. Measurement protocols, population-specific distributions and cut points, and correlations with BMI and other body-size variables all affect interpretation. Likewise, including race/ethnicity and socioeconomic variables may improve statistical discrimination while also reproducing inequities in access, diagnosis, or exposure. Before implementation, calibration, sensitivity, specificity, and referral rates should be examined across clinically relevant subgroups, and race/ethnicity should not be treated as a biological mechanism.The next step is validation rather than deployment. The locked logistic regression equations and thresholds should be evaluated temporally and geographically in later US samples and in populations outside the United States, with attention to predictor harmonization, missingness, calibration-in-the-large, calibration slope, and threshold recalibration. Prospective studies should compare the model with simpler risk scores and guideline-based approaches, quantify laboratory referrals, missed cases, costs, harms, uptake, and subgroup equity, and determine whether model-guided prioritization improves patient-important or health-system outcomes. Only such studies can establish clinical utility. Until then, the model should be regarded as a research-stage tool for preliminary non-laboratory risk stratification based on cross-sectional data.Strengths and limitationsStrengths include the large seven-cycle NHANES sample; complex-survey weighting; a prespecified, leakage-controlled predictor set; separate training, validation, and held-out test subsets; validation-locked model and threshold selection; and comparison of 18 pipelines with logistic regression. PSU bootstrap confidence intervals, calibration analyses, decision curves, and complete-case sensitivity analyses provided complementary evidence. The prespecified parsimony rule aligned model selection with the small differences in AUC and the value of interpretability.This study has several limitations. The cross-sectional design supports discrimination, not temporal prediction or causality, and all partitions came from pooled 2005–2018 NHANES. Without prospective external validation, performance and generalizability in later US settings and particularly in populations outside the United States remain uncertain. Outcomes combined a single HbA1c measurement with self-reported diagnosis or treatment; the undiagnosed endpoint lacked repeat confirmation, fasting glucose, and OGTT, and the pragmatic criterion used to exclude type 1 diabetes may have led to participant misclassification. PPV, NPV, calibration, and the Youden-derived thresholds are context-dependent, and internal decision curves do not establish clinical utility. SHAP values do not imply causality and are affected by correlations among features. Subgroup fairness, costs, harms, workflow impact, and patient outcomes were not evaluated. The model is not a substitute for laboratory confirmation.ConclusionAcross 18 weighted pipelines using 11 non-laboratory predictors, logistic regression was selected in both NHANES cohorts and performed comparably to more complex methods. In held-out test data, its AUC was 0.8355 in the prevalent cohort and 0.8270 in the undiagnosed cohort; at the locked undiagnosed threshold, sensitivity was 0.8339, specificity was 0.6500, and PPV was 0.0523. The findings favor parsimony and transparent benchmarking and do not indicate an advantage for algorithmic complexity. The model should be regarded only as a research-stage aid for preliminary non-laboratory risk stratification and for prioritizing laboratory assessment. It cannot diagnose or exclude T2DM or replace guideline-recommended confirmation. Prospective external validation, recalibration, subgroup assessment, and impact evaluation are required before clinical use.Data availabilityPublicly available datasets were analyzed in this study. This data can be found here: https://github.com/Wujiezhong/new-t2dm.ReferencesIdrees, T., Castro-Revoredo, I., Dhatariya, K. K., Hernandez, L. & Umpierrez, G. E. Advances in the management of hyperglycaemia and diabetes mellitus during hospitalization. Nat. Rev. Endocrinol. 21, 757–768 (2025).Article  PubMed  Google Scholar Azzam, A. Y. et al. Epidemiological patterns of diabetes mellitus in the United States of America: an observational multicenter analysis from 1990 to 2024. ASIDE Int. Med. 1, 1–7 (2025).Google Scholar Tomic, D., Shaw, J. E. & Magliano, D. J. The burden and risks of emerging complications of diabetes mellitus. Nat. Rev. Endocrinol. 18, 525–539 (2022).Article  PubMed  PubMed Central  Google Scholar DeFronzo, R. A. From the triumvirate to the ominous octet: a new paradigm for the treatment of type 2 diabetes mellitus. Diabetes 58, 773–795 (2009).Article  CAS  PubMed  PubMed Central  Google Scholar Donath, M. Y. & Shoelson, S. E. Type 2 diabetes as an inflammatory disease. Nat. Rev. Immunol. 11, 98–107 (2011).Article  CAS  PubMed  Google Scholar Galicia-Garcia, U. et al. Pathophysiology of type 2 diabetes mellitus. Int. J. Mol. Sci. 21, 6275 (2020).Article  CAS  PubMed  PubMed Central  Google Scholar GBD 2021 Diabetes Collaborators. Global, regional, and national burden of diabetes from 1990 to 2021, with projections of prevalence to 2050: a systematic analysis for the Global Burden of Disease Study 2021. Lancet 402, 203–234 (2023).Article  Google Scholar Chen, Z. et al. Ultra-processed food consumption and risk of type 2 diabetes: three large prospective U.S. cohort studies. Diabetes Care. 46, 1335–1344 (2023).Article  PubMed  PubMed Central  Google Scholar Kim, Y., Cho, Y., Kim, J. E., Lee, D. H. & Oh, H. Ultra-processed food intake and risk of type 2 diabetes mellitus: a dose-response meta-analysis of prospective studies. Diabetes Metab. J. 49, 1064–1074 (2025).Article  PubMed  PubMed Central  Google Scholar Villena Gonzales, W., Mobashsher, A. T. & Abbosh, A. The progress of glucose monitoring—a review of invasive to minimally and non-invasive techniques, devices and sensors. Sensors 19, 800 (2019).Article  PubMed  PubMed Central  Google Scholar Sun, H. et al. IDF diabetes atlas: global, regional and country-level diabetes prevalence estimates for 2021 and projections for 2045. Diabetes Res. Clin. Pract. 183, 109119 (2022).Article  PubMed  Google Scholar Tuppad, A. & Patil, S. D. Machine learning for diabetes clinical decision support: a review. Adv. Comput. Intell. 2, 22 (2022).Article  PubMed  PubMed Central  Google Scholar Kavakiotis, I. et al. Machine learning and data mining methods in diabetes research. Comput. Struct. Biotechnol. J. 15, 104–116 (2017).Article  PubMed  PubMed Central  Google Scholar Uddin, S., Khan, A., Hossain, M. E. & Moni, M. A. Comparing different supervised machine learning algorithms for disease prediction. BMC Med. Inf. Decis. Mak. 19, 281 (2019).Article  Google Scholar Riveros Perez, E. & Avella-Molano, B. Learning from the machine: is diabetes in adults predicted by lifestyle variables? A retrospective predictive modelling study of NHANES 2007–2018. BMJ Open. 15, e096595 (2025).Article  PubMed  PubMed Central  Google Scholar Lee, H. et al. Prediction model for type 2 diabetes mellitus and its association with mortality using machine learning in three independent cohorts from South Korea, Japan, and the UK: a model development and validation study. EClinicalMedicine 80, 103069 (2025).Article  PubMed  PubMed Central  Google Scholar Casagrande, S. S. et al. Comparison of several survey-based algorithms to ascertain type 1 diabetes among US adults with self-reported diabetes. BMJ Open. Diabetes Res. Care. 8, e001917. https://doi.org/10.1136/bmjdrc-2020-001917 (2020).Article  PubMed  PubMed Central  Google Scholar Olusanya, M. O., Ogunsakin, R. E., Ghai, M. & Adeleke, M. A. Accuracy of machine learning classification models for the prediction of type 2 diabetes mellitus: a systematic survey and meta-analysis approach. Int. J. Environ. Res. Public. Health. 19, 14280 (2022).Article  PubMed  PubMed Central  Google Scholar Kodama, S. et al. Predictive ability of current machine learning algorithms for type 2 diabetes mellitus: a meta-analysis. J. Diabetes Investig. 13, 900–908 (2022).Article  PubMed  PubMed Central  Google Scholar Qin, Y. et al. Machine learning models for data-driven prediction of diabetes by lifestyle type. Int. J. Environ. Res. Public. Health. 19, 15027 (2022).Article  PubMed  PubMed Central  Google Scholar Bentéjac, C., Csörgő, A. & Martínez-Muñoz, G. A comparative analysis of gradient boosting algorithms. Artif. Intell. Rev. 54, 1937–1967 (2021).Article  Google Scholar US Preventive Services Task Force. Screening for prediabetes and type 2 diabetes: US Preventive Services Task Force recommendation statement. JAMA 326, 736–743 (2021).Article  Google Scholar American Diabetes Association Professional Practice Committee. 2. Diagnosis and classification of diabetes: standards of care in diabetes—2025. Diabetes Care. 48, S27–S49 (2025).Article  Google Scholar Manne-Goehler, J. et al. Health system performance for people with diabetes in 28 low- and middle-income countries: a cross-sectional study of nationally representative surveys. PLoS Med. 16, e1002751 (2019).Article  PubMed  PubMed Central  Google Scholar Alberti, K. G. et al. Harmonizing the metabolic syndrome: A joint interim statement of the International Diabetes Federation Task Force on Epidemiology and Prevention; National Heart, Lung, and Blood Institute; American Heart Association; World Heart Federation; International Atherosclerosis Society; and International Association for the Study of Obesity. Circulation 120, 1640–1645 (2009).Article  CAS  PubMed  Google Scholar Ross, R. et al. Waist circumference as a vital sign in clinical practice: a Consensus Statement from the IAS and ICCR Working Group on Visceral Obesity. Nat. Rev. Endocrinol. 16, 177–189 (2020).Article  PubMed  PubMed Central  Google Scholar Download referencesAcknowledgementsThe authors have no acknowledgments to report.FundingThis study was funded by BESTI Teaching Cultivation and Incubation Program (Grant Number: jy202634 and jy202638); this study was supported by "the Fundamental Research Funds for the Central Universities" (Grant Number: 3282026011).Author informationAuthor notesHaotian Jin and Runqi Tong contributed equally to this work.Authors and AffiliationsDepartment of Humanities and Social Science, Beijing Electronic Science and Technology Institute, Fengtai, 100070, Beijing, ChinaHaotian JinSchool of Information Communication Engineering, Beijing Information Science and Technology University, Haidian, 100192, Beijing, ChinaRunqi TongGraduate Department, Beijing Electronic Science and Technology Institute, Fengtai, 100070, Beijing, ChinaKaili DouDepartment of Cybernet Security, Beijing Electronic Science and Technology Institute, Fengtai, 100070, Beijing, ChinaYilong Li & Ziyin ZhouDepartment of Physical Education, Fuzhou University, Fuzhou, 350108, ChinaJiezhong WuGraduate School of Beijing Sport University, Beijing, 100091, ChinaJiezhong WuAuthorsHaotian JinView author publicationsSearch author on:PubMed Google ScholarRunqi TongView author publicationsSearch author on:PubMed Google ScholarKaili DouView author publicationsSearch author on:PubMed Google ScholarYilong LiView author publicationsSearch author on:PubMed Google ScholarZiyin ZhouView author publicationsSearch author on:PubMed Google ScholarJiezhong WuView author publicationsSearch author on:PubMed Google ScholarContributionsHaotian Jin and Runqi Tong contributed equally to this work. Haotian Jin and Runqi Tong contributed to the study conceptualization. Yilong Li and Ziyin Zhou were responsible for data curation, software implementation, and formal analysis using machine learning models. Haotian Jin, Kaili Dou, Yilong Li, and Ziyin Zhou developed the methodology. Kaili Dou and Haotian Jin drafted the original manuscript. Runqi Tong and Jiezhong Wu reviewed the manuscript. All authors read and approved the final manuscript.Corresponding authorCorrespondence to Jiezhong Wu.Ethics declarationsCompeting interestsThe authors declare no competing interests.Ethics approval and consent to participateThe National Center for Health Statistics Research Ethics Review Board approved the NHANES protocols. Written informed consent was obtained from all adult participants. All methods adhered to the relevant guidelines and regulations, including the Declaration of Helsinki.Additional informationPublisher’s noteSpringer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.Supplementary InformationBelow is the link to the electronic supplementary material.Supplementary Material 1 (download DOCX )Rights and permissionsOpen Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.Reprints and permissionsAbout this article