Codeverse: Journal of Emerging Digital Realities
Vol. 2 No. 2 (2026): CODEVERSE: Journal of Emerging Digital Realities

Toddler Nutritional Status Classification Using the K-Nearest Neighbor Algorithm

Anjela Zindi Aprilya Titioka (Universitas Pattimura)
Sanlly Joanne Latupeirissa (Universitas Pattimura)
Novita Serly Laamena (Universitas Pattimura)



Article Info

Publish Date
29 Nov 2026

Abstract

Nutritional status classification among children under five is important for identifying nutritional conditions and supporting public health monitoring. This study aims to classify the nutritional status of children under five using the K-Nearest Neighbor (K-NN) algorithm. The dataset comprised 681 records obtained from Rumah Tiga Public Health Center, Ambon, in February 2025. Four predictor variables were used: sex, age, weight, and height. The original five nutritional status categories were recategorized into two classes: normal and abnormal. To address class imbalance, random undersampling was applied exclusively to the training data. The dataset was divided into training and testing sets using stratified sampling at an 80:20 ratio. Numerical predictors were standardized using parameters estimated from the training data. The optimal number of neighbors was selected through Repeated Stratified 5-Fold Cross-Validation with 10 repetitions, evaluating candidate values of K from 1 to 23. Balanced accuracy was used as the primary selection criterion. The results indicated that K = 1 achieved the highest average balanced accuracy during cross-validation and was therefore selected as the optimal model. On the testing set, the model achieved an accuracy of 83.94%, balanced accuracy of 82.85%, precision of 65.91%, recall of 80.56%, specificity of 85.15%, and F1-score of 72.50%. These findings indicate that K-NN can classify the nutritional status categories recorded in the dataset with reasonably balanced performance. However, further evaluation using data from multiple health centers and longer observation periods is needed to assess the model's generalizability.

Copyrights © 2026






Journal Info

Abbrev

codeverse

Publisher

Subject

Description

Codeverse: Journal of Emerging Digital Realities is a peer-reviewed journal dedicated to the exchange of high-quality research results in all aspects of statistics, data science, computer science, and information technology. This journal publishes cutting-edge articles in basic theory, experiments, ...