Analisis Sentimen Terhadap Program (MBG) Pada Twitter Menggunakan Algoritma K-Nearest Neighbors
DOI:
https://doi.org/10.59061/jentik.v4i3.1582Abstract
Abstract. Program Makan Bergizi Gratis (MBG) is one of the Indonesian government's initiatives that has attracted significant public attention on the social media platform Twitter (X). The large volume of opinions expressed by Twitter users generates extensive textual data, making sentiment analysis necessary to identify public perceptions of the program. This study aims to analyze public sentiment toward the Free Nutritious Meals (MBG) Program using the K-Nearest Neighbors (KNN) algorithm. The results show that the K-Nearest Neighbors algorithm achieved an accuracy of 88% in classifying sentiments toward the MBG Program. For the negative sentiment class, the model obtained a precision of 0.90 and a recall of 0.97, while for the positive sentiment class, it achieved a precision of 0.61 and a recall of 0.30. The difference in performance between the two sentiment classes was influenced by the imbalanced distribution of the dataset, where negative sentiment data outnumbered positive sentiment data. Overall, the findings indicate that the K-Nearest Neighbors algorithm provides satisfactory performance in analyzing public sentiment toward the Free Nutritious Meals (MBG) Program on the Twitter (X) platform.
Abstrak. Program Makan Bergizi Gratis (MBG) merupakan salah satu program pemerintah yang banyak menjadi perbincangan masyarakat di media sosial Twitter (X). Beragamnya opini yang disampaikan pengguna Twitter menghasilkan data teks dalam jumlah besar sehingga diperlukan analisis sentimen untuk mengetahui kecenderungan persepsi masyarakat terhadap program tersebut. Penelitian ini bertujuan untuk menganalisis sentimen masyarakat terhadap Program Makan Bergizi Gratis (MBG) menggunakan algoritma K-Nearest Neighbors (KNN). Hasil penelitian menunjukkan bahwa algoritma K-Nearest Neighbors memperoleh akurasi sebesar 88% dalam mengklasifikasikan sentimen terhadap Program MBG. Pada kelas sentimen negatif diperoleh nilai precision sebesar 0,90 dan recall sebesar 0,97, sedangkan pada kelas sentimen positif diperoleh precision sebesar 0,61 dan recall sebesar 0,30. Perbedaan performa tersebut dipengaruhi oleh distribusi dataset yang tidak seimbang, di mana jumlah data sentimen negatif lebih banyak dibandingkan sentimen positif. Secara keseluruhan, hasil penelitian menunjukkan bahwa algoritma K-Nearest Neighbors mampu memberikan performa yang baik dalam melakukan analisis sentimen terhadap Program Makan Bergizi Gratis (MBG) pada media sosial Twitter.
References
Alif Bais Khoiriyah. (2025, November 21). Program MBG Nasional Tingkatkan Peran UMKM, Dorong Pertumbuhan Ekonomi Nasional.
Eddy Cahyono Sugiarto. (2024, December 18). Makan Bergizi Gratis dan SDM Unggul.
Fatkhurrohman, F., Nugroho, B. I., & Fadillah, N. (2025). Analisis Sentimen Program Makan Bergizi Gratis Pemerintah RI Melalui Twitter Menggunakan Metode SVM. RIGGS: Journal of Artificial Intelligence and Digital Business, 4(3), 3906–3917. https://doi.org/10.31004/riggs.v4i3.2533
Halder, R. K., Uddin, M. N., Uddin, Md. A., Aryal, S., & Khraisat, A. (2024). Enhancing K-nearest neighbor algorithm: a comprehensive review and performance analysis of modifications. Journal of Big Data, 11(1), 113. https://doi.org/10.1186/s40537-024-00973-y
Hovi, H. S. W., Id Hadiana, A., & Rakhmat Umbara, F. (2022). Prediksi Penyakit Diabetes Menggunakan Algoritma Support Vector Machine (SVM). Informatics and Digital Expert (INDEX), 4(1), 40–45. https://doi.org/10.36423/index.v4i1.895
Ilona Estherina. (2025, August 15). Penerima Makan Bergizi Gratis Ditargetkan 82,9 Juta hingga Akhir 2025.
Jim, J. R., Talukder, M. A. R., Malakar, P., Kabir, M. M., Nur, K., & Mridha, M. F. (2024). Recent advancements and challenges of NLP-based sentiment analysis: A state-of-the-art review. Natural Language Processing Journal, 6, 100059. https://doi.org/10.1016/j.nlp.2024.100059
Kementerian Kesehatan Republik Indonesia. (2025, May 26). SSGI 2024: Prevalensi Stunting Nasional Turun Menjadi 19,8%.
Mao, Y., Liu, Q., & Zhang, Y. (2024). Sentiment analysis methods, applications, and challenges: A systematic literature review. Journal of King Saud University - Computer and Information Sciences, 36(4), 102048. https://doi.org/10.1016/j.jksuci.2024.102048
Martony, O. (2023). Stunting di Indonesia: Tantangan dan Solusi di Era Modern. Journal of Telenursing (JOTING), 5(2), 1734–1745. https://doi.org/10.31539/joting.v5i2.6930
Putri Ajie, Z., & Wardhana, A. (2025). Analisis Sentimen Negatif Publik pada Tagar #KaburAjaDulu di Media Sosial “X.” Jurnal Audiens, 6(3), 430–442. https://doi.org/10.18196/jas.v6i3.608
Putriyekti, A., Sulistiawati, D., Khairani, N., Rizky, R., Kusuma, A., Keuangan, P., & Stan, N. (2025). ANALISIS MULTIDIMENSIONAL SENTIMEN MASYARAKAT TERHADAP PROGRAM MAKAN BERGIZI GRATIS PADA MEDIA SOSIAL X. Integrative Perspectives of Social and Science Journal, 2(1), 1004.
Putu Alya Noviyanti, N., Gusti Ngurah Anom Cahyadi Putra, I., Studi Informatika, P., Matematika dan Ilmu Pengetahuan Alam, F., Raya Kampus UNUD, J., Jimbaran, B., & Selatan, K. (2025). Penerapan Multinomial Naïve Bayes dan Chi-Square pada Analisis Sentimen Makan Bergizi Gratis. JNATIA, 3(4).
Rendy, M., Hamdi, M., Muhammadiyah Jember, U., & Pemerintahan, J. I. (2025). PERAN PEMERINTAH DALAM MENGATASI STUNTING: UPAYA BERSAMA UNTUK PERTUMBUHAN DAN PEMBANGUNAN BERKELANJUTAN THE GOVERNMENT’S ROLE IN TACKLING STUNTING: JOINT EFFORTS FOR SUSTAINABLE GROWTH AND DEVELOPMENT. In Jurnal Interelasi (Vol. 1).
Sirichanya, C., & Kraisak, K. (2021). Semantic data mining in the information age: A systematic review. International Journal of Intelligent Systems, 36(8), 3880–3916. https://doi.org/10.1002/int.22443
Suprapto, F. A., Praditya, E., Dewi, R. M., & Adiyoso, W. (2025). A Policy Implementation Review of the Free Nutritious Meal (MBG) Program. The Journal of Indonesia Sustainable Development Planning, 6(2), 297–312. https://doi.org/10.46456/jisdep.v6i2.798
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Jurnal Elektronika dan Teknik Informatika Terapan ( JENTIK )

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.






