There are many thyroid diseases affecting people all over the world. Many diseases affect the thyroid gland, like hypothyroidism, hyperthyroidism, and thyroid cancer. Thyroid inefficiency can cause severe symptoms in patients. Effective classification and machine learning play a significant role in the timely detection of thyroid diseases. This timely classification will indeed affect the timely treatment of the patients. Automatic and precise thyroid nodule detection in ultrasound pictures is critical for reducing effort and radiologists’ mistake rate. Medical images have evolved into one of the most valuable and consistent data sources for machine learning generation. In this paper, various machine learning algorithms like decision tree, random forest algorithm, KNN, and artificial neural networks on the dataset create a comparative analysis to better predict the disease based on parameters established from the dataset. Also, the dataset has been manipulated for accurate prediction for the classification. The classification was performed on both the sampled and unsampled datasets for better comparison of the dataset. After dataset manipulation, we obtained the highest accuracy for the random forest algorithm, equal to 94.8% accuracy and 91% specificity.