Stunting is a health issue that has a negative impact on people's quality of life and the development of a bangsa. Finding the cause of stunting accurately is a crucial step in developing effective mitigation strategies. K-Nearest Neighbor (K-NN) is one machine learning algorithm that is frequently used for classification and data analysis, but its performance is greatly impacted by the choice of an ideal K parameter. This study highlights the use of metaheuristic algorithms, such as genetic algorithms (GA) and particle swarm optimization (PSO), to optimize K in K-NN in order to identify the stunting factor. This method uses the kekuatan eksplorasi and eksploitasi algoritma metaheuristik to determine parameter K that yields optimal accuracy. Based on the results of the metaheuristic algorithm, it is concluded that without optimization, K-NN only achieves an accuracy of roughly 63%, highlighting the importance of choosing a suitable K value. When GA is used in K-NN optimization, the accuracy increases significantly, reaching 73%, indicating its ability to effectively explore the solution space. On the other hand, PSO also increases accuracy to 74%. It is hoped that the results of this study will provide significant contributions to the development of a more reliable model for analyzing the factors that contribute to stunting, thereby enhancing the use of data-based decision-making in attempts to address the stunting problem holistically.
Copyrights © 2025