Penerapan Algoritma K-Nearest Neighbor (Knn) Untuk Klasifikasi Status Gizi Balita di Kecamatan Rumbai Timur - Marshanda Marshanda; Nurliana Nasution (STMIK Royal Kisaran, 2026)
Abstract: This study aims to classify the nutritional status of toddlers based on anthropometric data using the K-Nearest Neighbor (KNN) algorithm. Data were obtained from 20 Integrated Health Posts (Posyandu) in Rumbai Timur District, including Lembah Sari Village and Limbungan Village with a total of 1,000 toddler data. After cleaning and preprocessing, 782 data were obtained ready for use. The preprocessing stages include data cleaning and transformation, outlier removal, minority class handling, and data normalization. Next, data balancing was carried out using the Synthetic Minority Oversampling Technique (SMOTE) to address class imbalance. The data was divided into 80% training data and 20% test data, then the K parameter was tested from 1 to 15 using 5-fold cross-validation. The results showed that the value of K = 1 provided the best performance with a macro recall of 0.8827 and an accuracy of 86.26%. These results indicate that the combination of the KNN algorithm with the SMOTE method and Min-Max normalization is effective in improving classification performance on imbalanced data and producing accurate and balanced predictions of toddler nutritional status between classes. Keywords: k-nearest neighbor; toddler nutritional status; SMOTE; min-max scaling; classification; anthropometric data Abstrak: Penelitian ini bertujuan untuk mengklasifikasikan status gizi balita berdasarkan data antropometri menggunakan algoritma K-Nearest Neighbor (KNN). Data diperoleh dari 20 Posyandu di Kecamatan Rumbai Timur, meliputi Kelurahan Lembah Sari dan Kelurahan Limbungan dengan total 1.000 data balita. Setelah melalui proses cleaning dan preprocessing, diperoleh 782 data yang siap digunakan. Tahapan pra-pemrosesan meliputi pembersihan dan transformasi data, penghapusan outlier, penanganan kelas minoritas, serta normalisasi data. Selanjutnya dilakukan penyeimbangan data menggunakan Synthetic Minority Oversampling Technique (SMOTE) untuk mengatasi ketidakseimbangan kelas. Data dibagi menjadi 80% data latih dan 20% data uji, kemudian dilakukan pengujian parameter K dari 1 hingga 15 menggunakan 5-fold cross-validation. Hasil penelitian menunjukkan bahwa nilai K = 1 memberikan performa terbaik dengan recall macro sebesar 0,8827 dan akurasi 86,26%. Hasil ini menunjukkan bahwa kombinasi algoritma KNN dengan metode SMOTE dan normalisasi Min-Max efektif dalam meningkatkan kinerja klasifikasi pada data tidak seimbang serta menghasilkan prediksi status gizi balita yang akurat dan seimbang antar kelas. Kata kunci: k-nearest neighbor; status gizi balita; SMOTE; min-max scaling; klasifikasi; data antropometri