Taken together, 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 CEBPB; the disease is metabolic dysfunction-associated steatotic liver disease.