Optimasi Algoritma KNN dengan Parameter K dan PSO Untuk Klasifikasi Status Gizi Balita
DOI:
https://doi.org/10.30865/mib.v8i3.7841Keywords:
Nutritional Status, K-Nearest Neighbor, Particle Swarm Optimization, Classification, Parameter SelectionAbstract
The toddler years are a crucial phase that requires constant nutritional monitoring, because rapid growth and development require optimal nutritional intake. Nutritional problems in toddlers can hinder physical growth and can even be fatal. In assessing the nutritional status of toddlers, it is important to use efficient methods. One approach that can be used is machine learning, which can help determine the nutritional status of toddlers. K-Nearest Neighbors (KNN) is an algorithm commonly used in object classification based on nearest neighbors. Even though it is simple, determining the correct K value is very important because it can significantly influence KNN performance. This research emphasizes the importance of choosing the right parameters to increase the accuracy of the KNN model in classifying the nutritional status of toddlers. The test results show that the optimal combination for KNN is at K=4, using the 'distance' weight and distance metric p=1, producing the highest accuracy of 91.15% on the test data. Furthermore, the research applied Particle Swarm Optimization (PSO) to optimize KNN parameters, and it was found that the optimal combination was with K=6, 'distance' weight, and distance metric p=1, achieving a mean accuracy of 93.44% and a test accuracy of 93.98%. PSO is proven to be effective in finding the best parameters that increase model generalization to test data. Test results with a training data ratio of 80% and testing 20% show the best accuracy of 93.98%. .The use of PSO for parameter optimization succeeded in increasing model accuracy by 3.10% compared to the model without optimization
References
H. Saleh, M. Faisal, and R. I. Musa, “Klasifikasi Status Gizi Balita Menggunakan Metode K-Nearest Neighbor,†Simtek J. Sist. Inf. dan Tek. Komput., vol. 4, no. 2, pp. 120–126, 2019, doi: 10.51876/simtek.v4i2.60.
E. Ramon, A. Nazir, N. Novriyanto, Y. Yusra, and L. Oktavia, “Klasifikasi Status Gizi Bayi Posyandu Kecamatan Bangun Purba Menggunakan Algoritma Support Vector Machine (SVM),†J. Sist. Inf. dan Inform., vol. 5, no. 2, pp. 143–150, 2022, doi: 10.47080/simika.v5i2.2185.
D. Fitrianingsih, M. Bettiza, and A. Uperiati, “Klasifikasi Status Gizi Pada Pertumbuhan Balita Menggunakan K-Nearest Neighbor (Knn),†Student Online J., vol. 2, no. 1, pp. 106–111, 2021.
Moch. Rizky Yuliansyah, M. B, and A. Franz, “Perbandingan Metode K-Nearest Neighbors dan Naïve Bayes Classifier Pada Klasifikasi Status Gizi Balita di Puskesmas Muara Jawa Kota Samarinda,†Adopsi Teknol. dan Sist. Inf., vol. 1, no. 1, pp. 08–20, Jun. 2022, doi: 10.30872/atasi.v1i1.25.
N. L. M. Diah Putri Anggaraeningsih and H. Yuliati, “Hubungan Status Gizi Balita Dan Perkembangan Anak Balita Di Kelurahan Liliba Kecamatan Oebobo,†J. Heal. Sains, vol. 3, no. 7, pp. 830–836, Jul. 2022, doi: 10.46799/jhs.v3i7.545.
B. Fitria Rahmiati, “Upaya Perbaikan Status Gizi Balita Melalui Sosialisasi Menu Mp-Asi Sesuai Usia Balita Di Kecamatan Gunungsari,†JPMB J. Pemberdaya. Masy. Berkarakter, vol. 2, no. 2, pp. 138–145, 2019.
Kemenkes RI, “Hasil Survei Status Gizi Indonesia (SSGI) 2022,†Kemenkes, pp. 1–150, 2022.
S. Lestari and R. A. Amalia, “Penerapan Algoritma C. 45 Pada Klasifikasi Status Gizi Balita di Posyandu Desa Sukalilah Cibatu Kabupaten Garut Jawa Barat,†J. Sains dan Teknol., vol. 5, no. 1, pp. 177–182, 2023,.
E. R. Pratama and J. B. B. Darmawan, “Klasifikasi Status Gizi Balita Menggunakan Jaringan Syaraf,†Ris. dan Teknol. Terap., pp. 1–10, 2021.
R. Setiawan and A. Triayudi, “Klasifikasi Status Gizi Balita Menggunakan Naïve Bayes dan K-Nearest Neighbor Berbasis Web,†J. MEDIA Inform. BUDIDARMA, vol. 6, no. 2, p. 777, Apr. 2022, doi: 10.30865/mib.v6i2.3566.
A. M. Argina, “Penerapan Metode Klasifikasi K-Nearest Neigbor pada Dataset Penderita Penyakit Diabetes,†Indones. J. Data Sci., vol. 1, no. 2, pp. 29–33, 2020, doi: 10.33096/ijodas.v1i2.11.
N. Azizah, M. Riyad Firdaus, R. Suyaningsih, and F. Indrayatna, “Penerapan Algoritma Klasifikasi K-Nearest Neighbor pada Penyakit Diabetes,†Pros. Semin. Nas. Stat. Aktuaria, vol. 2, no. 1, pp. 119–126, 2023.
K. Widyatmoko, E. Sugiarto, M. Muslih, and F. Budiman, “Optimasi Metode K-Nearest Neighbor Dengan Particle Swarm Optimization Untuk Pengenalan Citra Batik Dengan Ragam Hias Geometris,†J. Inform. Upgris, vol. 8, no. 1, 2022, doi: 10.26877/jiu.v8i1.11705.
S. Sumarni and S. Rustam, “Klasifikasi Topik Tugas Akhir Mahasiswa menggunakan Algoritma Particle Swarm Optimization dan K-Nearest Neighbor,†Ilk. J. Ilm., vol. 12, no. 2, pp. 168–175, Aug. 2020, doi: 10.33096/ilkom.v12i2.604.168-175.
O. Pahlevi, A. Amrin, and Y. Handrianto, “Optimasi Algoritma Naïve Bayes Berbasis Particle Swarm Optimization Untuk Klasifikasi Status Stunting,†Comput. Sci., vol. 4, no. 1, pp. 37–43, 2024, doi: 10.31294/coscience.v4i1.2963.
H. Zulfia and F. Santi Wahyuni, “Optimasi Particel Swarm Optimazation (PSO) Untuk Penentuan Base Tranciver Sistem (BTS),†2020.
I. L. Putra, “Implementasi Algoritma Particle Swarm Optimization(Pso) Dan K-Nearest Neighbor(K-Nn) Dalam Memprediksi Keberhasilan Anak Smk Mendapatkan Kerja,†Technol. J. Ilm., vol. 13, no. 4, p. 339, 2022, doi: 10.31602/tji.v13i4.8167.
P. Arsi, R. Wahyudi, and R. Waluyo, “Optimasi SVM Berbasis PSO pada Analisis Sentimen Wacana Pindah Ibu Kota Indonesia,†J. RESTI (Rekayasa Sist. dan Teknol. Informasi), vol. 5, no. 2, pp. 231–237, Apr. 2021, doi: 10.29207/resti.v5i2.2698.
Q. A. A’yuniyah and M. Reza, “Penerapan Algoritma K-Nearest Neighbor Untuk Klasifikasi Jurusan Siswa Di Sma Negeri 15 Pekanbaru,†Indones. J. Inform. Res. Softw. Eng., vol. 3, no. 1, pp. 39–45, 2023, doi: 10.57152/ijirse.v3i1.484.
R. A. Anggraini, G. Widagdo, A. S. Budi, and M. Qomaruddin, “Penerapan Data Mining Classification untuk Data Blogger Menggunakan Metode Naïve Bayes,†J. Sist. dan Teknol. Inf., vol. 7, no. 1, p. 47, 2019, doi: 10.26418/justin.v7i1.30211.
W. Musu, A. Ibrahim, and Heriadi, “Pengaruh Komposisi Data Training dan Testing terhadap Akurasi Algoritma C4.5,†Pros. Semin. Ilm. Sist. Inf. Dan Teknol. Inf., vol. X, no. 1, pp. 186–195, 2021.
Downloads
Published
Issue
Section
License

This work is licensed under a Creative Commons Attribution 4.0 International License
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under Creative Commons Attribution 4.0 International License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (Refer to The Effect of Open Access).