Obesity is a complex health issue that needs a strategy for assessing its severity to facilitate earlier recognition. One can determine an individual's obesity classification by analyzing their dietary habits, level of physical activity, and overall health status. This research aims to ascertain the K-Nearest Neighbor (KNN) algorithm's efficacy in accurately classifying seven various phases of obesity. The dataset employed for predicting obesity consisted of 2,111 samples drawn from a population of both genders. For KNN testing, the dataset was divided into training and test data, with the test data allocated over three separate scenarios, including varying ratios. The ratios of 70:30, 80:20, and 90:10 were utilized in these circumstances, respectively. The value of k was varied from k=2 to k=10. The optimal configuration was achieved with a 90:10 data split ratio and a k value of 2, as evidenced by the test results. This setup concurrently attained an accuracy of 90.05%, a precision of 90.56%, a recall of 89.80%, and an F1 score of 90.18%. This categorization error was most prominent when comparing the Normal Weight category to the Class I Overweight group. A properly preprocessed KNN algorithm can attain competitive accuracy over 90 percent in classifying population obesity levels, as demonstrated by this study's findings.
Copyrights © 2026