Medium-term risk prediction for incident type 2 diabetes in patients with histologically confirmed NAFLD using machine learning: insights from two cohorts
Non-alcoholic fatty liver disease (NAFLD), now increasingly discussed within the framework of metabolic dysfunction-associated steatotic liver disease (MASLD), is closely associated with type 2 diabetes. Early identification of NAFLD patients at increased risk of incident type 2 diabetes may support timely intervention. We retrospectively included patients with histologically confirmed NAFLD from two Chinese tertiary hospitals. Baseline was defined as the date of histological diagnosis of NAFLD. Follow-up duration was calculated from baseline to the first documented diagnosis of incident type 2 diabetes or to the last available clinical record for patients without incident diabetes. The prediction target was incident type 2 diabetes during the available follow-up period after baseline, representing medium-term risk rather than fixed 1-year, 3-year, or 5-year absolute risk. LASSO regression was used for feature selection within the training set. Seven machine learning models were developed and evaluated, including logistic regression, decision tree, random forest, XGBoost, LightGBM, support vector machine, and artificial neural network. Model performance was assessed using ROC curves, calibration curves, decision curve analysis, and external validation. Additional sensitivity analyses accounting for follow-up duration were performed, including Cox proportional hazards regression, time-dependent ROC analysis, follow-up-adjusted logistic regression, and 3-year landmark analysis. SHAP analysis was used to interpret the final model. LASSO identified five predictors: waist circumference, fasting plasma glucose, triglycerides, family history of diabetes, and neutrophil-to-lymphocyte ratio. ANN achieved the highest performance in the internal validation set. Therefore, all seven candidate models were further evaluated in the independent external validation cohort to assess generalizability. XGBoost showed the best overall external validation performance and was selected as the final model based primarily on external validation results, calibration, and decision curve analysis. XGBoost achieved an AUC of 0.99 in the training set and 0.89 in the external validation set. Sensitivity analyses accounting for follow-up duration, including Cox proportional hazards regression, time-dependent ROC analysis, follow-up-adjusted logistic regression, and 3-year landmark analysis, showed that the main findings were materially unchanged. SHAP analysis was subsequently used to interpret the final model and showed that fasting plasma glucose, waist circumference, triglycerides, family history of diabetes, and neutrophil-to-lymphocyte ratio contributed to individualized risk prediction. An externally validated and interpretable machine learning framework based on routinely available clinical variables may help identify NAFLD patients at increased medium-term risk of incident type 2 diabetes during the available follow-up period after histological diagnosis. The value of this approach lies in integrated risk stratification rather than the novelty of individual predictors. Further prospective multicenter validation with standardized follow-up intervals and prespecified fixed prediction horizons is required before routine clinical implementation.
Authors
- Yixiang Xing
- Yun Shen (ORCID: https://orcid.org/0000-0002-9850-122X)
- Yahui Wu (ORCID: https://orcid.org/0009-0002-3233-3777)
- Min Kang
- Qihang Gao
- Ke Lei
Institutions
- Changzhi Medical College (CN)
- The People's Hospital Tongling (CN)
- Tongling University (CN)
Publication Details
- Journal
- Diabetology & Metabolic Syndrome
- Published
- 2026-09-25
- DOI
- https://doi.org/10.1186/s13098-026-02302-0
- Primary Topic
- Liver Disease Diagnosis and Treatment
- Type
- article
- Field-Weighted Citation Impact
- 0.00