Stunting is a serious problem for the health of toddlers, who experience malnutrition during their development. Poor nutritional intake or a lack of knowledge about nutrition can be a factor in stunting. This study aims to optimize the stunting classification algorithm in toddlers using the K-Nearest Neighbor algorithm, Support Vector Machine, and Naïve Bayes by using bagging optimization. This study uses toddler data totaling 10,000 records, 7 attributes, and 2 classes taken from Krobokan Health Center, Semarang City. Based on the findings of this study, the Bagging Method shows excellent performance with 89.77% accuracy, 95.57% precision, 85.45% recall, and a 90.27% F1-score. This shows great potential for improving the model's ability to classify data with a high degree of accuracy, completeness, and balance. The SVM model has a high recall of 80.59%, while the Naïve Bayes model gets an F1-score of 71.84%, indicating that Naïve Bayes has a good balance between precision and recall. Overall, the Bagging Model is the best choice, with far superior performance compared to other models. Based on the results obtained, the Bagging Method can predict stunting data accurately, showing a very good level of truth in stunting prediction efforts.