Based on the results of univariate analysis, LASSO regression analysis and multifactor analysis, a final nomogram model with age, diabetes, ascites, spontaneous peritonitis, alanine transaminase, and blood potassium as predictors of hepatic encephalopathy risk prediction was created. This evidence concerns the gene GPT and diabetes mellitus.