Machine learning combined with consensus clustering analysis revealed a greater prevalence of periodontitis among patients with diabetes mellitus in Cluster B. This cluster was characterized by a smoking habit, a lower education level, a higher income-to-poverty ratio, and higher levels of albumin (ALB g/L) and alanine aminotransferase (ALT U/L). The gene discussed is GPT; the disease is periodontitis.