Researchers have developed a machine learning framework to predict the medium-term risk of developing type 2 diabetes among patients with histologically confirmed non-alcoholic fatty liver disease, known as NAFLD. The study, published in Diabetology & Metabolic Syndrome, utilized data from two independent Chinese tertiary hospital cohorts to evaluate the generalizability of various predictive models. By leveraging routinely available clinical variables, the team aimed to identify individuals at increased risk of incident diabetes during the follow-up period following their liver diagnosis.
The research team, led by Ke Lei and Yun Shen, retrospectively included patients with histologically confirmed NAFLD from two Chinese tertiary hospitals. The baseline for each patient was defined as the date of their histological diagnosis of NAFLD. Follow-up duration was calculated from this baseline until the first documented diagnosis of incident type 2 diabetes or until the last available clinical record for patients who did not develop diabetes. The prediction target was specifically defined as incident type 2 diabetes during the available follow-up period, representing a medium-term risk rather than a fixed absolute risk at one, three, or five years.
To identify the most relevant predictors, the researchers employed Least Absolute Shrinkage and Selection Operator, or LASSO, regression for feature selection within the training set. This statistical method helped narrow down the variables to five key predictors: waist circumference, fasting plasma glucose, triglycerides, family history of diabetes, and the neutrophil-to-lymphocyte ratio.
Seven distinct machine learning models were developed and evaluated to determine which algorithm offered the best predictive performance. These models included logistic regression, decision tree, random forest, XGBoost, LightGBM, support vector machine, and artificial neural network. Model performance was rigorously assessed using receiver operating characteristic curves, calibration curves, and decision curve analysis. Additionally, the models underwent external validation to ensure their findings were not merely artifacts of the training data but could be generalized to new patient populations.
In the internal validation set, the artificial neural network achieved the highest performance. However, to assess generalizability, all seven candidate models were further evaluated in the independent external validation cohort. The XGBoost model demonstrated the best overall performance in this external validation, leading the researchers to select it as the final model. This selection was based primarily on its external validation results, calibration, and decision curve analysis, which collectively indicated its robustness and clinical utility.
The selected XGBoost model achieved an area under the curve of 0.99 in the training set and 0.89 in the external validation set. These metrics indicate a high level of discriminative ability, with the external validation score confirming that the model maintains strong predictive power when applied to a different patient group. To further ensure the reliability of these findings, the researchers conducted sensitivity analyses accounting for follow-up duration. These analyses included Cox proportional hazards regression, time-dependent receiver operating characteristic analysis, follow-up-adjusted logistic regression, and a three-year landmark analysis. The results showed that the main findings were materially unchanged across these different analytical approaches.
To interpret the final model and understand the contribution of individual variables, the researchers applied SHAP, or SHapley Additive exPlanations, analysis. This technique provided insights into how each predictor influenced the risk prediction for individual patients. The analysis confirmed that fasting plasma glucose, waist circumference, triglycerides, family history of diabetes, and the neutrophil-to-lymphocyte ratio were the primary drivers of the predicted risk.
The study concludes that 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. The value of this approach lies in its ability to provide integrated risk stratification rather than relying on the novelty of individual predictors. However, the authors emphasize that further prospective multicenter validation with standardized follow-up intervals and prespecified fixed prediction horizons is required before this tool can be implemented in routine clinical practice.
Subject of Research: Machine learning prediction of type 2 diabetes risk in NAFLD patients
Article Title: Medium-term risk prediction for incident type 2 diabetes in patients with histologically confirmed NAFLD using machine learning: insights from two cohorts
Article References: Lei, K., Wu, Y., Xing, Y., Gao, Q., Kang, M., & Shen, Y. (2026). Medium-term risk prediction for incident type 2 diabetes in patients with histologically confirmed NAFLD using machine learning: insights from two cohorts. Diabetology & Metabolic Syndrome. https://doi.org/10.1186/s13098-026-02302-0
Image Credits: AI Generated
DOI: 10.1186/s13098-026-02302-0
Keywords: NAFLD, Type 2 Diabetes, Machine Learning, Risk Prediction, XGBoost, Clinical Variables, External Validation, SHAP Analysis, Medium-term, risk, prediction, incident
News Source: Teresa Odom. (November 8, 2026). Machine Learning Predicts Diabetes Risk in NAFLD Patients. Scienmag.



