Development and Internal Validation of an Interpretable Machine Learning Screening Model for MAFLD–Diabetes Mellitus Comorbidity: A Cross-Sectional NHANES Study
Abstract
Background: The rising global prevalence and bidirectional relationship between metabolic-associated fatty liver disease (MAFLD) and diabetes mellitus (DM) significantly exacerbate adverse target-organ outcomes. Despite this, non-invasive screening frameworks remain lacking. This study aims to bridge this gap by developing and validating an individualized, machine learning-based risk prediction model for this comorbidity using routine clinical and biochemical phenotypes. Methods: Clinical data of 5,383 adult participants were extracted from the National Health and Nutrition Examination Survey (NHANES 2021-2023) database for retrospective analysis. The cohort was partitioned into a training set and a testing set at a 7:3 ratio. Following feature selection combining LASSO regression and the random forest (RF) algorithm, ten machine learning models were constructed and comparatively evaluated using 10-fold cross-validation. Model discrimination and calibration were comprehensively assessed utilizing the area under the receiver operating characteristic curve (AUC), calibration curves, and Brier scores. The SHAP framework was then applied to quantify feature contributions to the predictive outcomes, culminating in the development of a static web-based tool for individualized risk assessment. Results: Compared to the non-comorbidity group (n = 4,801), the comorbidity group (n = 582) exhibited a significantly heavier metabolic burden, characterized by older age and a higher BMI. Following dual feature dimensionality reduction, 23 candidate variables were identified. Among the 10 machine learning algorithms evaluated, the artificial neural network (ANN) demonstrated the best overall performance. Through SHAP-based feature refinement, an optimized ANN model relying on only 13 routine clinical and biochemical indicators was ultimately established. In the testing set, this model achieved excellent discrimination (AUC = 0.863) and the lowest Brier score (0.073), coupled with an exceptionally high probabilistic goodness-of-fit (Hosmer-Lemeshow P = 0.370). Its discriminative performance showed no statistically significant difference from that of the full-feature model (P = 0.894). SHAP explainability analysis indicated that serum osmolality and serum sodium (Na) were the core indicators with the highest predictive contribution to this comorbidity risk. Finally, the online assessment tool deployed from this model successfully enabled the non-invasive, real-time calculation of comorbidity probabilities. Conclusion: This study developed and validated a robust 13-feature ANN model for predicting MAFLD-DM comorbidity, highlighting the indicative value of systemic homeostasis and electrolyte imbalances. The derived web-based tool offers cost-effective, non-invasive clinical decision support for early risk stratification and "dual metabolic-hepatic management".