In conclusion, CEBPD, H4C11, CEBPB, GATA3, and KLF4 were identified as diagnostic biomarkers of NAFLD by machine learning algorithms and were related to immune cell infiltration in NAFLD. The gene discussed is H4C11; the disease is metabolic dysfunction-associated steatotic liver disease.