Stunting is a chronic nutritional problem in toddlers that can affect physical growth, cognitive development, and children's health quality in the future. This study aims to analyze and compare the performance of the K-Nearest Neighbors (KNN) and Naïve Bayes algorithms in classifying stunting risk in toddlers using a public dataset from Kaggle. The research was conducted through several stages, including data preprocessing, data cleaning, normalization using the Min-Max method, data balancing using SMOTE-ENN, splitting training and testing data, and parameter optimization using Grid Search. Model evaluation was carried out using a Confusion Matrix with accuracy, precision, Recall, F1-score, ROC Curve, and AUC Score metrics. The results showed that the KNN algorithm performed better than the Naïve Bayes algorithm in classifying stunting risk. The KNN algorithm produced higher accuracy, precision, Recall, and F1-score values, as well as more optimal ROC-AUC values for each classification class. Based on these evaluation results, the KNN algorithm was considered more effective and stable in detecting stunting risk in toddlers compared to the Naïve Bayes algorithm. Therefore, the KNN algorithm can be used as an effective method to support early stunting risk detection based on Machine Learning.
Copyrights © 2026