1. Introduction
Recent studies have demonstrated the feasibility of estimating HbA1c using machine-learning techniques applied to heterogeneous data sources, including lifestyle variables, electronic health records, longitudinal glucose measurements, and non-invasive physiological signals [
1,
2,
3,
4,
5,
6,
7]. Collectively, this body of work confirms that surrogate-feature–based HbA1c modeling is clinically meaningful. Most existing approaches focus on classification or short-term prediction tasks rather than continuous HbA1c regression across population-scale cohorts; many rely on high-dimensional or costly feature sets that limit scalability, and interpretability is often treated as a post hoc analysis rather than being integrated into model design. These limitations highlight the need for modeling frameworks that explicitly balance predictive accuracy, feature parsimony, and explainability, particularly in large epidemiological datasets where HbA1c measurements may be incomplete.
In response to these challenges, we propose a machine-learning framework guided by three principal goals:
Accurate and interpretable HbA1c prediction from routinely available clinical, biochemical, and demographic variables.
Cost-optimized biomarker estimation, achieved by identifying a minimal yet high-performing subset of predictors, thereby reducing dependency on extensive laboratory panels.
Explainable and transferable modeling architecture, enabling its application beyond HbA1c prediction into other chronic-disease biomarkers.
Although our framework additionally enables a fourth benefit—imputation of missing HbA1c values to enrich large-scale datasets—this study places strong emphasis on the modeling innovations: prediction accuracy, cost reduction, and interpretability. While point-of-care (PoC) devices provide rapid HbA1c measurements for individual clinical encounters, they represent single-time-point assessments that require physical testing. In contrast, the proposed framework focuses on modeling cumulative glycemic exposure as reflected by HbA1c using routinely available physiological and biochemical variables. This distinction enables retrospective estimation, large-scale epidemiological analysis, and dataset enrichment in scenarios where direct HbA1c measurement—whether laboratory-based or PoC—is unavailable or impractical. The data-enrichment function is discussed as a consequential, practical benefit rather than the primary innovation.
Our approach departs from prior work through the integrated design of feature selection, validation, and interpretability within a single regression-based framework. Firstly, we implement a two-stage feature-selection strategy: (i) Incremental Correlation Selection (ICS), which ranks features by their correlation with the target while reducing redundancy; followed by (ii) Recursive Feature Elimination with Cross-Validation (RFECV), which iteratively prunes features while optimizing performance. This layered approach offers computational efficiency and model interpretability. Secondly, we adopt stratified regression cross-validation for a continuous target, ensuring that each fold preserves the distribution of HbA1c across its range—thus improving generalizability and reducing bias in performance estimation. Thirdly, we benchmark multiple regression algorithms (including tree-based, linear-based, and boosting models) under consistent preprocessing and imputation scenarios, to identify the best trade-off between accuracy, parsimony, and interpretability. Finally, we embed explainability mechanisms into the workflow: feature-importance ranking, partial-dependence plots, and clinically meaningful variable ordering ensure the model is not a black box but a tool for insight as well as prediction. Accordingly, this work is structured around the following focused research questions:
Q1: To what extent can HbA1c be predicted accurately and interpretably from a reduced subset of routinely available clinical features?
Q2: What is the potential for cost-reduced biomarker estimation when the feature-set is minimized yet model performance remains robust?
Q3: How transferable and explainable is the proposed modeling pipeline for applications beyond HbA1c, in other chronic-disease biomarker contexts?
Machine learning (ML) and data-mining approaches have become foundational in diabetes research for disease detection, risk stratification, and biomarker modeling. However, when the target is continuous HbA1c estimation, as opposed to binary classification, far fewer studies deliver both high predictive accuracy and clinically useful interpretability in heterogeneous populations. Below, we review prior literature across five thematic streams: (a) diabetes classification and risk prediction, (b) HbA1c and glycemic biomarker estimation, (c) feature selection and interpretability in medical ML, (d) hybrid/ensemble and advanced modeling, and (e) explainable or longitudinal HbA1c modeling. We then summarize the gaps and position our contribution.
Diagnosing diabetes is crucial to lowering its rising prevalence. Various ML techniques, such as K-Nearest Neighbors, Support Vector Classifier, Logistic Regression, Gaussian Naive Bayes, and Random Forest, are used in medical science to analyze medical data and draw conclusions. The authors of [
8] aimed to make use of the most important features, not all of them. They employed Logistic Regression after cleaning the data and selecting possible features. Their suggested method performed better than certain current methods that make use of ML models. The authors of [
9] developed a computational approach that combines several forms of physical examination data to predict diabetes risk. A model based on eXtreme Gradient Boosting (XGBoost) was created to differentiate diabetic patients, yielding an AUC of 0.8768. Additionally, to enhance the model’s practicality and adaptability in clinical and real-world settings, a diabetes risk scorecard was developed using logistic regression to assess human health. The data were then statistically examined to determine the main variables affecting patients’ ability to manage their diseases. As presented in [
10], an imbalanced dataset presents a challenge and needs to be balanced for diabetes prediction using multiple ML methods, such as Tomek and SMOTE. These outliers are also managed using the IQR method.
To evaluate and synthesize primary studies published in six digital libraries between 2000 and 2020, the authors of [
11] carried out a systematic literature review. Thirty-two primary papers were chosen and examined in light of eight review questions. According to their findings, ensembles were more popular in recent years and generally outperformed single models. Nevertheless, a number of shortcomings in the ensembles’ building procedure and performance measures were found. They offered suggestions for creating accurate ensembles for predicting blood glucose levels. As presented in [
12], a review of ten studies on diabetes prognosis employed diverse ML techniques, including CNN, SVM, RF, KNN, NB, ANN, GB, AdaBoost, and LR. Their findings demonstrated the growing reliance on ML in diabetes prediction, although performance varied across models. Building on this, the authors of [
13] highlighted limitations in early diabetes identification, such as time consumption and poor feature selection accuracy. To address these, an improved Recursive Feature Elimination (RFE) method combined with a hybrid bagging classifier was proposed, leading to improved accuracy and specificity.
As proposed in [
14], the discrepancy between HbA1c measurements and blood glucose-derived estimates was emphasized. Using clustering-based personalized models on real-world clinical datasets, K-means local nonlinear regressors (NLR) were applied to improve HbA1c estimation, achieving significantly lower mean absolute differences compared to general models. Similarly, the authors also explored boosting algorithms on the PIMA dataset, concluding that Gradient Boosting achieved the highest accuracy (92.85%) after comprehensive preprocessing and validation. An ensemble framework was later presented in [
15], which introduced KFPredict by integrating a multi-input neural network with ML algorithms through soft voting. This method outperformed single classifiers, reaching 93.5% accuracy and substantially enhancing sensitivity and specificity. Likewise, a Clinical Decision Support System (CDSS) using the PIMA dataset and multiple classifiers has been developed [
16]. By combining preprocessing, hyperparameter tuning, and a rule-based layer, accuracies above 90% for decision tree and histogram-based gradient boosting models were achieved and delivered through a web-based interface.
As presented in [
17], an ensemble approach with AdaBoost for type II diabetes detection was applied, achieving 83% efficiency. A broader comparative analysis was carried out in [
18], where a super-learner model reached 86% accuracy on the PIMA dataset and 97% on an early-stage diabetes dataset. Further advancements were made in [
19], which introduced a tri-ensemble voting classifier with KNN imputation, attaining exceptional results—97.49% accuracy and 99.35% recall—demonstrating the importance of proper handling of missing data. Optimization-based approaches were presented in [
20], which employed genetic algorithms for hyperparameter tuning and Particle Swarm Optimization (PSO) for data balancing. This framework showed substantial improvements in accuracy, AUC, and APR, with XGBoost yielding the most efficient results on CDC data. As presented in [
21], the authors proposed an IoT-driven diabetes monitoring system integrating real-time data, hybrid optimization (K-means clustering and Sailfish Optimization), and deep learning (Bi-LSTM). Their model outperformed traditional methods, especially in imbalanced data settings. As presented in [
22], a Deep Neural Network (DNN) framework was applied for diabetes risk assessment using biometric and clinical features, achieving an accuracy of 82%. Similarly, the authors also examined type II diabetes early detection using SVM, RF, and logistic regression on the PIMA dataset, where logistic regression achieved the best accuracy (79%) after hyperparameter tuning.
Explainable AI gained momentum in [
23], where LIME and SHAP were leveraged for interpretability in logistic regression and random forest models trained on large-scale survey data. This approach reached 86% accuracy while highlighting model transparency. As proposed in [
24], Natural Language Processing (NLP) was applied to EHRs of over 23,000 patients, predicting disease progression stages with up to 80% accuracy and identifying key determinants of metabolic deterioration. As presented in [
25], the authors combined real-world data and RCT findings to predict HbA1c changes using various ML models, showing that follow-up models with dynamic patient data achieved superior results compared to baseline or RCT-only models. Large-scale studies were also conducted in [
26], where ML models were trained on a dataset of over 556,000 medical examinations. XGBoost proved most effective, with 97.5% accuracy and 0.971 ROC-AUC. As presented in [
27], the authors enhanced XGBoost through Bayesian optimization, achieving marginally better performance than grid search methods, reinforcing the algorithm’s potential for diabetes prediction and prevention. As presented in [
28], the authors aimed to describe national trends in HbA1c among insulin-treated people with type 1 or type 2 diabetes (2009–2020 NHANES) and to quantify the proportions achieving ADA-recommended and individualized HbA1c targets by diabetes type and insulin regimen. As presented in [
29], the authors aimed to quantify how often HbA1c-based and glucose-based measures give mismatched classifications of normoglycemia, prediabetes, and diabetes in the U.S. population (NHANES 2005–2016), and to assess the clinical implications of such misclassification. The authors of [
30] aimed to evaluate how well the ADA/AAP pediatric clinical screening guideline identifies youth with prediabetes/diabetes based on biomarker-defined status in NHANES data, and to compare its performance with machine learning classifiers as a first step toward a simple, accurate questionnaire-based youth diabetes risk tool.
As proposed in [
31], the authors aimed to compare multiple machine learning algorithms for predicting diabetes in adults using only lifestyle and easily obtainable variables (NHANES 2007–2018), in order to explore their potential as non-invasive tools for early diabetes risk detection. The literature shows substantive progress in classification and risk models, including NHANES-based ML studies, yet there remains a conspicuous gap for continuous HbA1c regression in large, representative cohorts. Prior HbA1c-oriented work often relies on specialized data (e.g., CGM users) rather than population-scale surveys, and interpretability is frequently applied post hoc without addressing outliers or heterogeneity. As proposed in [
32], the authors developed a machine-learning framework for the detection and prediction of chronic diseases, focusing in particular on heart attack risk using the BRFSS dataset. They addressed the strong class imbalance through rigorous data cleaning, feature selection, and hyperparameter tuning of models such as LightGBM, XGBoost, and logistic regression, ultimately building an ensemble that achieved improved balanced accuracy and recall for high-risk cases, demonstrating the value of ML-based early risk stratification in cardiovascular disease.
As explained in [
33], the authors proposed a novel approach that combines layer-weighted attention with an ascending feature selection strategy to predict the seriousness level of adverse drug events using FAERS data. By jointly modeling NLP-derived representations of active substances and structured demographic/event features, and progressively adding the most informative variables, their method achieved strong performance and highlighted how carefully designed attention mechanisms and feature selection can enhance pharmacovigilance risk prediction. As presented in [
34], the authors provided an innovative framework that employs tailored semantic embedding together with recent ML models to predict the seriousness of drug–drug interactions based on FAERS reports. Using advanced biomedical word vectors and powerful classifiers such as CatBoost, their approach captures subtle relationships between co-administered drugs and associated outcomes, enabling more precise assessment of DDI severity for clinical decision support and pharmacovigilance.
We address these limitations by centering the task on continuous HbA1c prediction from NHANES 2007–2020, combining a two-stage feature selection pipeline—Incremental Correlation Selection followed by RFECV—with a stratified regression cross-validation design that balances performance across the HbA1c spectrum. To strengthen interpretability beyond standard post hoc tools, we introduce Enhanced Partial Dependence Plots (EPDPs), which restrict attention to informative value ranges and dampen outlier influence, yielding clearer and more clinically faithful marginal effects. In contrast to classification-oriented systems and physiology-aware frameworks that do not target continuous HbA1c on population data, our approach unifies robust selection, high-fidelity regression, and refined interpretability in a single, reproducible pipeline. As presented in
Table 1, a list of abbreviations for the whole paper is included.
In summary, existing research provides strong foundations in diabetes classification, ensemble modeling, and explanation techniques, but lacks a cohesive, interpretable pipeline for continuous HbA1c prediction on NHANES scale cohorts. To facilitate transparent comparison, the next section (
Section 2) provides a detailed description of the dataset used in this study (NHANES 2007–2020), including cohort characteristics, feature composition, preprocessing procedures, and feature statistics.
Section 3 explains the full methodology—data preparation, two-stage feature selection, model training, and evaluation protocol.
Section 5 presents experiments and results.
Section 4 discusses the findings by explicitly answering the research questions.
Section 5 concludes with contributions, limitations, and directions for future work.
2. Materials and Methods
This study uses data from the National Health and Nutrition Examination Survey (NHANES) cycles 2007–2020, a rich, nationally representative dataset of the U.S. civilian non-institutionalized population that integrates detailed clinical, laboratory, anthropometric, and questionnaire data. The central outcome of interest is HbA1c (variable LBXGH in NHANES)—a proven marker of long-term glycemic exposure. NHANES is a repeated cross-sectional survey conducted in biennial cycles rather than a continuous or longitudinal study. Each participant contributes a single examination record per survey cycle, with clinical assessments, laboratory measurements, and questionnaires collected at the time of enrollment.
2.1. Data Sources and Consolidation
We merged multiple NHANES components—including demographics, examination (physiological/anthropometric) data, laboratory biochemistry panels, complete blood-count and urine/kidney metrics, lifestyle questionnaires, and environmental exposures—across cycles. Harmonizing variable names, units, and definitions across cycles was essential. The initial combined dataset comprised 66,148 participant-records and 224 numeric candidate features spanning diverse health-related domains. At the raw dataset level, the merged NHANES cohort comprised 66,148 participant records. Participant ages spanned a wide range, with a median age of approximately 28 years (interquartile range: 10–54 years), reflecting the broad population coverage of NHANES. Sex distribution was approximately balanced (male: 33,355; female: 32,793).
2.2. Feature Categorization
To structure the analysis and support cost-efficiency considerations, features were organized into nine coherent categories: Demographics; Anthropometry (including BMI and waist circumference); Blood Pressure; Complete Blood Count (CBC); Biochemistry (such as glucose, lipids, albumin-creatinine ratio, etc.); Kidney/Urine Measures; Environmental/Exposure Markers; Lifestyle/Questionnaire Measures; and Derived Ratios (for example waist-to-hip or lipid ratio variables). This categorization enabled targeted missing-value inspections, facilitated analysis of cost-proxy features, and shaped the subsequent filtering and selection strategy. Collectively, these feature categories capture a broad spectrum of medical conditions and comorbidities relevant to metabolic and cardiovascular health, including markers related to glucose regulation, lipid metabolism, adiposity, renal function, blood pressure, inflammation, and lifestyle-associated risk factors. The dataset is predominantly composed of numerical variables, including laboratory measurements, anthropometric indices, and physiological indicators. The final feature set includes both continuous numerical variables and discrete categorical variables derived from NHANES demographic, socioeconomic, and survey-administration fields. Categorical variables include sex, race/ethnicity, education level, marital status, citizenship, household composition, income-related indicators, language and proxy-response variables, survey cycle identifiers, and selected clinical status indicators (e.g., blood-pressure status). In total, 33 categorical variables were included and encoded during preprocessing, while the remaining features consist of continuous laboratory measurements, anthropometric indicators, and physiological variables.
2.3. Data Cleaning and Missing-Value Filtering
Initial exploration revealed that roughly 48.6% of cells in the feature matrix were missing. No assumption of missing completely at random (MCAR) was made for the NHANES data. Given the survey-based nature of NHANES, missingness may depend on participant characteristics, examination protocols, or laboratory subsampling, and is therefore more plausibly missing at random (MAR) or missing not at random (MNAR). To mitigate potential bias arising from non-MCAR missingness, we applied conservative feature-level filtering, removed variables with excessive missingness, and performed imputation strictly within the cross-validation framework to avoid information leakage. To preserve analytic robustness and avoid instability from sparsely populated features, any variable with more than 60% missing entries was removed—a pragmatic threshold commonly used in large-scale observational and machine-learning studies to exclude features with excessive missingness, where the exact cutoff is chosen to balance information retention, model stability, and bias–variance trade-offs. to reduce bias and ensure model reliability. While no universal missing cutoff exists, prior methodological work consistently recommends removing features with very high proportions of missing values to avoid unstable imputation and unreliable model estimates in population-scale datasets [
35,
36]. After eliminating high-missing features, records lacking a measured HbA1c value were excluded solely for supervised model training and evaluation, as a ground-truth target is required for regression-based learning and unbiased performance assessment. This resulted in an analytic sample of 42,208 participants with 125 numeric features. Importantly, the exclusion of participants without measured HbA1c values was limited to the supervised training and validation phases. Once the model was robustly trained using observed HbA1c values, it can be applied to estimate HbA1c for records where laboratory measurements are missing. This separation between model development and downstream application avoids target leakage and preserves methodological validity, while still enabling dataset enrichment through post-training HbA1c estimation.
2.4. Imputation and Pre-Processing
Among the remaining features, four numeric imputation strategies were compared: no imputation (row exclusion), mean substitution, median substitution, and most-frequent substitution. All imputation and scaling (z-score standardization) were performed within the cross-validation framework to avoid leakage.
2.5. Final Feature-Set
From the cleaned set of 125 numeric features, our two-stage feature-selection pipeline produced a final predictive subset of 40 features. Pearson correlation was retained as the primary reported metric, as it directly reflects linear associations relevant to regression-based modeling, while Spearman and Kendall correlations were evaluated only as robustness checks to assess sensitivity to non-linearity and outliers. A comprehensive list of health-related variables and their characteristics is provided in
Appendix A Table A1, and the extended correlation visualizations are provided in
Appendix A Figure A1 and
Figure A2.
Our proposed methodology provides an advanced machine-learning framework, explicitly designed to achieve three interconnected objectives:
Accurate and interpretable HbA1c prediction using routinely collected clinical and biochemical features.
Cost-efficient biomarker estimation by identifying a minimal but highly informative set of predictors.
A transferable and explainable modeling architecture that can be applied beyond HbA1c to other chronic-disease biomarkers.
The innovation of this framework comes from the integration of preprocessing, dual-stage feature-selection, model benchmarking, stratified regression validation, and explainability tools into a cohesive pipeline. Each stage is carefully aligned to one or more of the objectives, rather than being treated as an afterthought.
2.6. Workflow Overview
As illustrated in
Figure 1, our workflow proceeds through the following major phases:
Data consolidation and cleaning
Preprocessing and imputation strategy comparison
Dual-stage feature-selection (combining filter and wrapper methods)
Model benchmarking via stratified regression cross-validation
Interpretability and explainability analysis
Figure 1.
Workflow for proposed HbA1c prediction.
Figure 1.
Workflow for proposed HbA1c prediction.
What elevates this methodology is that feature-selection is not isolated; it is co-designed with model performance and interpretability in mind. Likewise, the model benchmarking is informed by cost-efficient feature use, and the explainability layer is embedded rather than appended.
2.7. Model Benchmarking (Experiment 1)
We comparatively assess a suite of regression algorithms: ExtraTreesRegressor, RandomForestRegressor, RidgeCV, HuberRegressor, LinearSVR, LinearRegression, XGBoostRegressor, and LightGBMRegressor. Each algorithm is evaluated using stratified-5-fold regression cross-validation (see
Section 3.5) to maintain representativeness of the HbA1c target distribution. The selected algorithm must not only deliver high accuracy but also operate within the compact-feature, interpretable framework we target. Hyperparameter optimization was not performed extensively for individual models. Instead, all regression algorithms were evaluated using standard or commonly adopted default configurations to ensure fair comparison and reproducibility across experiments. This design choice was intentional, as the primary focus of the study is on the impact of feature selection, cost-oriented parsimony, and evaluation strategy rather than aggressive model-specific tuning.
2.8. Imputation Strategy Optimization (Experiment 2)
Large-scale survey datasets such as NHANES automatically involve missing values. To maximize cost-efficiency and model robustness, we evaluate four numeric imputation strategies: mean substitution, median substitution, most-frequent substitution, and no substitution (using features as they appear). Each strategy is nested within the cross-validation folds to prevent leakage. The chosen strategy is the one that optimizes the metrics (R2, MAE, MAPE), supporting our cost-efficient biomarker estimation objective.
2.9. Dual-Stage Feature-Selection Strategy (Experiments 3 and 4)
Our key innovation lies in the two-stage feature-selection pipeline, combining filter and wrapper approaches to deliver a compact, high-signal predictor set that meets cost- and interpretability-goals. Feature selection was conducted within the cross-validation framework to avoid information leakage. Specifically, the two-stage feature-selection process (Incremental Correlation Selection followed by RFECV) was applied independently within each training fold, and the resulting feature subset was then used to evaluate performance on the corresponding held-out test fold. No feature information from the test data was used during feature selection. The final feature set reported in the manuscript corresponds to the configuration that consistently yielded the best aggregate out-of-fold performance and is presented for interpretability and deployment considerations.
2.9.1. Stage 1—Incremental Correlation Selection (ICS)
ICS is a filter method that ranks each candidate feature
according to its linear correlation with the target variable HbA1c (
). Only those features with strong individual association and minimal redundancy progress to the next phase. This supports both cost-efficiency and interpretability as in Equation (1):
where
and
are the means of feature
and the target, respectively. We then rank features in descending order of
. The ICS Algorithm is based on the following steps:
Compute correlation for each feature with HbA1c.
Sort features by absolute correlation value, highest first.
Incrementally build subsets by adding features one by one (from highest correlation downward), train a model for each subset, evaluate the performance (e.g., R2), and stop when performance no longer improves significantly as explained in Equation (2).
where
are the predicted values. The value
that maximizes R
2 determines the candidate subset size from ICS.
2.9.2. Stage 2—Recursive Feature Elimination with Cross-Validation (RFECV)
The RFECV is a wrapper method that, starting with the subset produced by ICS, iteratively removes the least-important features (as determined by the model’s importance measures) and uses cross-validation at each elimination step to find the optimal subset. This supports model interpretability and cost-efficient estimation in Equation (3).
where
= cross-validated score (e.g., R
2) for a model trained with
features,
is the starting number of features, and
is the minimum number of features allowed. The RFECV Algorithm is explained as follows:
Begin with the features from Stage 1.
For each from down to : train the model using stratified CV, compute score .
Remove the feature with the lowest importance.
Continue until the optimal is found (the highest average CV score).
Return , the feature set of size .
2.9.3. Integrated Algorithm—Combined ICS + RFECV
This integrated algorithm (Algorithm 1) directly addresses cost-efficiency (minimal, high-signal features) and interpretability (transparent selection process, model-based elimination).
| Algorithm 1. Combined Algorithm |
Input full feature set , target HbA1c , estimator , CV folds. Compute for each feature . Rank features by descending . Incrementally add features from the highest rank onward; for each subset size , train , compute R2; select that gives maximal R2. Set current feature subset top features. For k = down to :
- ○
Train using with stratified CV; compute score . - ○
Identify and remove the feature in with the lowest importance.
Let = value of with highest ; return = features at .
|
2.10. Stratified Regression Cross-Validation
Traditional k-fold CV may lead to uneven representation of the continuous target variable across folds. Stratified regression CV mitigates this by discretizing the target variable (HbA1c) into quantile-based bins and ensuring each fold contains samples from each bin. This improves performance estimation reliability across the full range of the target, as explained in Equation (4).
where
= number of folds,
is the model trained on all but fold
, and
are the true targets in fold
. The Stratified Regression Algorithm is explained as follows:
Partition the continuous HbA1c values into quantile-bins.
Create folds such that each fold has proportional representation from each bin.
For each fold: train the model on the other folds, validate on the current fold; compute metric .
Average the metrics across folds to get .
Only records with observed HbA1c values were included during model training and cross-validation, while HbA1c estimation for records without laboratory measurements is treated as a post-training application of the finalized model.
Stratified regression cross-validation was adopted to ensure that each fold preserves the distribution of HbA1c values across its range. Unlike standard k-fold cross-validation, which may produce imbalanced folds when the target variable is continuous and skewed, stratified regression reduces evaluation bias and improves stability by maintaining comparable target distributions in training and test sets. Group cross-validation was not applicable in this setting because NHANES data are cross-sectional, with no repeated measurements or subject-level grouping that would otherwise require group-wise partitioning to prevent information leakage.
2.11. Interpretability and Explainability
Aligned with our objective of a transferable, explainable modeling architecture, for the final selected model, we compute:
Feature importance vector w or tree-based importance scores.
Partial dependence plots (PDP): for feature
,
SHAP values: .
These tools convert predictive power into interpretive insight, enabling clinicians and researchers to understand how each variable drives HbA1c.
2.12. Evaluation Metrics and Validation
Model performance is assessed using: coefficient of determination (R
2), mean absolute error (MAE), mean squared error (MSE) and mean absolute percentage error (MAPE). All results derive from stratified-5-fold cross-validation and are reported as fold-averaged values. Residual analyses and training-validation loss curves are inspected to detect potential overfitting or heteroscedasticity.
In summary, the methodology we present weaves together preprocessing, imputation, dual-stage feature selection, robust model benchmarking, and interpretability into a coherent, goal-driven pipeline. By integrating the filter-based ICS and wrapper-based RFECV into one unified algorithmic flow, applying stratified regression cross-validation, and embedding explainability tools from the start, our framework moves beyond traditional modeling frameworks to a purpose-built architecture for accurate, cost-efficient, and transparent HbA1c prediction. This methodological design not only underpins our current study but also lays the foundation for future extensions into other chronic-disease biomarkers, ensuring the research is both scientifically rigorous and practically deployable.
4. Discussion
The final LightGBM regression model, optimized through the integrated ICS + RFECV feature-selection pipeline, was analyzed for interpretability using feature importance ranking, Partial Dependence Plots (PDPs), and SHAP (Shapley Additive Explanation) analysis. This section aims to evaluate the transparency of the model’s internal reasoning and validate that the identified patterns are consistent with the physiological mechanisms underlying HbA1c regulation.
The emphasis on explainability is central to the framework’s third objective—the development of a transferable and explainable modeling architecture that enhances trust, interpretability, and usability in biomedical research and healthcare systems.
4.1. Feature-Importance Analysis
It is important to distinguish between feature relevance used during the selection phase and feature importance derived from the trained model. During feature selection, relevance metrics (e.g., correlation-based ranking in ICS and wrapper-based RFECV) were used to identify informative candidates while reducing redundancy. In contrast, post hoc explainability analyses reflect how the final trained model utilizes the selected features to generate predictions. The observed consistency between highly ranked features in the selection phase and dominant contributors in the explainability analysis provides additional validation of the stability and physiological coherence of the selected feature set, while differences highlight non-linear interactions learned by the model.
As presented in
Table 7, feature importance was extracted from the final LightGBM model using gain-based metrics averaged across the five cross-validation folds. The analysis revealed a coherent subset of biochemical and physiological indicators that consistently contributed most to the prediction of HbA1c levels. These features represent the key variables explored in the subsequent Partial Dependence analyses.
These predictors represent distinct physiological dimensions—glucose metabolism, adiposity, cardiovascular regulation, and protein status—that jointly influence long-term glycemic control. Their consistent appearance across folds confirms model stability and clinical coherence, reinforcing the framework’s interpretability objective.
4.2. Partial-Dependence Analysis
Enhanced Partial Dependence Plots were generated to visualize how each key variable influences predicted HbA1c while averaging over all others. The EPDPs isolate meaningful physiological trends by smoothing outliers and clarifying nonlinear behaviors.
Figure 6,
Figure 7,
Figure 8,
Figure 9,
Figure 10 and
Figure 11 present the refined relationships for the major predictors.
Two forms of partial dependence visualization are presented: a default partial dependence plot (Default PDP) and a custom-designed partial dependence plot (Custom PDP). The Default PDP follows the standard implementation, averaging model predictions across the full feature range, which may be influenced by sparse regions, extreme values, and uneven data density. In contrast, the Custom PDP restricts analysis to the effective interquartile range of each feature, applies uniform sampling within data-supported regions, and aggregates predictions using robust statistics. This approach explicitly suppresses outlier-driven effects, improves stability, and facilitates clearer comparison between observed empirical trends and model-learned relationships. As a result, the Custom PDP provides more clinically interpretable insights for population-level health data while preserving the underlying predictive behavior of the model. The comparison highlights how the custom PDP improves interpretability by reducing the influence of sparse or extreme values.
Serum glucose showed a strong, monotonic positive correlation with HbA1c predictions. The enhanced PDP highlighted a smooth upward trajectory: HbA1c values rose slowly at normal glucose concentrations (<5 mmol/L) and increased steeply beyond the pre-diabetic range. A gentle plateau at extreme values suggested physiological saturation of hemoglobin glycation rather than model instability. This confirms that the model accurately reproduces the biochemical linkage between chronic hyperglycaemia and HbA1c accumulation.
Age exhibited a gradual, nonlinear increase in predicted HbA1c. Variability was higher among younger individuals, reflecting lifestyle heterogeneity, whereas after middle age (≈45 years), the slope became steadily positive. A modest plateau beyond 70 years implies stabilization or competing effects of aging physiology. The enhanced PDP clarified this trend by filtering noise, demonstrating that age contributes a consistent but secondary effect relative to biochemical markers.
Blood pressure displayed a threshold-dependent relationship with HbA1c. At normal systolic levels (<120 mm Hg), the curve remained flat, indicating minimal glycemic impact. Above the pre-hypertensive threshold, HbA1c increased gradually, with a pronounced rise beyond 140 mm Hg, reflecting cardiovascular-metabolic coupling typical of metabolic syndrome. The enhanced PDP removed spurious spikes and produced a physiologically realistic progression from normotension to hypertension-associated glycemic stress.
At low BMI (<20 kg/m2), HbA1c varied little, but between 25 and 30 kg/m2 the curve steepened sharply, reflecting the metabolic transition from overweight to obesity. Above 35 kg/m2, the slope flattened, indicating that additional weight confers diminishing incremental glycemic effect—consistent with insulin-resistance saturation. The enhanced PDP reduced extreme outlier noise and highlighted this physiologically credible relationship between adiposity and long-term glucose control.
At typical concentrations (~4 g/dL), predicted HbA1c remained stable. Mild deviations at low or high albumin levels corresponded to subtle changes in predicted HbA1c, possibly reflecting nutritional status, hepatic function, or systemic inflammation rather than direct glycemic mechanisms. The enhanced PDP smoothed abrupt oscillations seen in the default version, suggesting that albumin’s effect is secondary and context-dependent but physiologically interpretable.
Weight alone showed limited direct influence on HbA1c predictions once BMI and waist-related measures were accounted for. The EPDP revealed scattered variability with a faint upward slope at extreme weights. This supports the notion that body composition, not absolute weight, is the more meaningful determinant of metabolic risk. Enhanced smoothing removed random fluctuations and confirmed the absence of spurious correlations.
4.3. SHAP Summary and Interaction Analysis
SHAP decomposition quantified each feature’s contribution to individual predictions. Positive SHAP values for serum-glucose and BMI corresponded to upward HbA1c shifts, whereas lower BMI and normal blood pressure exerted negative (protective) effects. The distribution of SHAP values was balanced across folds, indicating fairness and model consistency. Exploratory SHAP-interaction analysis revealed:
Synergy between serum glucose and BMI, amplifying HbA1c in obese hyperglycaemic individuals.
Age–BMI modulation, showing that older subjects experienced stronger BMI-related effects.
Minor interaction between albumin and blood pressure, likely reflecting hydration-status interplay.
These findings confirm that the model captures complex but clinically meaningful dependencies across metabolic domains.
4.4. Model Coherence and Statistical Validation
Residual diagnostics showed homoscedasticity and near-normal error distribution (Shapiro–Wilk
p > 0.05). The QQ-plot in
Figure 7 demonstrated close alignment between predicted and observed HbA1c quantiles, confirming proper calibration. The explainability outputs verify that the 40-feature LightGBM model maintains strong predictive performance while remaining physiologically transparent and statistically robust, as presented in
Table 8.
The explainability analysis demonstrates that the proposed HbA1c-prediction framework is accurate, interpretable, and physiologically grounded. It successfully identifies well-known glycemic drivers while uncovering secondary metabolic influences, thereby achieving transparency without sacrificing performance. By combining high predictive power (R2 ≈ 71.6%) with a reduced, interpretable feature set (40 variables), the model establishes a reproducible, cost-efficient, and clinically coherent foundation for next-generation AI-assisted metabolic assessment.
External validation is an important next step to strengthen the generalizability of the proposed HbA1c regression framework. While this study focuses on NHANES to establish a population-scale, interpretable, and cost-aware modeling pipeline, future work will evaluate the trained models and the full workflow (including preprocessing, imputation, ICS + RFECV feature selection, and stratified regression cross-validation) on independent public cohorts that contain HbA1c and overlapping clinical or demographic predictors. Such cross-dataset validation will help quantify transportability across different measurement protocols and populations. Where feature sets differ, we will use harmonized variable mappings and report performance using a consistent metric suite (e.g., R2, MAE, MSE, and MAPE), thereby providing a transparent benchmark of external validity beyond NHANES.