To explore the risk factors for thyroid nodules and their correlation with diabetes and stroke, the authors conducted a study on 1000 patients with metabolic syndrome (MS). The analysis included variables such as gender, age, familial thyroid disease, salt intake, iodine intake, smoking, alcohol consumption, sleep quality, mental stress, exercise, BMI, blood pressure, diabetes, and baseline nodules. The Apriori algorithm of machine learning was used to derive 12 association rules ([Formula: see text]), and the decision tree algorithm was used to derive 20 effective knowledge rules. The results showed that iodine intake, salt intake, BMI, and advanced age were high-risk factors for thyroid nodules. Exercise, BMI, and age were strongly correlated, while exercise, mental stress, iodine intake, and salt intake showed a strong correlation. Exercise, sleep, smoking, and alcohol consumption influenced mental stress, while age, diseases (diabetes, hypertension, obesity), and lifestyle habits influenced sleep quality. The risk of diabetes and stroke increased in patients with thyroid nodules, and there was a strong correlation among diabetes, stroke, and thyroid nodules.