Stunting is a chronic malnutrition problem caused by long-term inadequate nutritional intake, which causes children to be shorter than the standard height for their age. Stunting is often considered a hereditary factor; thus, this condition can lead to people becoming passive without proper preventive measures. Early detection is crucial for effective intervention. This study compares the XGBoost and Random Forest algorithms for detecting stunting in children and addresses the complex challenges associated with this process. Data were obtained from Kaggle and the Semarang City Health Office. The research went through a pre-processing stage before being combined. Optuna was used for automated hyperparameter tuning to achieve optimal accuracy. The results demonstrated the success of the stunting detection model, achieving an accuracy of 85.26% for XGBoost and 85.78% for Random Forest using unbalanced data, and 88.42% for XGBoost and 85.78% for Random Forest using balanced data. This study demonstrates these algorithms can address malnutrition issues effectively.
Copyrights © 2025