By combining WGCNA with various machine learning methods, we identified six key genes as biomarkers for NAFLD and AIS: CEBPD, SOCS2, THBS1, IFIT2, TNFSF10, and IL2RB. The gene discussed is THBS1; the disease is metabolic dysfunction-associated steatotic liver disease.