Analysis of Public Sentiment Towards the Free Nutritious Meals Program on TikTok Social Media Using the K-Nearest Neighbor Algorithm
DOI:
https://doi.org/10.30871/jaic.v10i1.11849Keywords:
Tiktok, K-Nearest Neighbor (KNN), Makan Bergizi Gratis (MBG), Sentimen Analysis, Free Nutritious Food Program, Public PolicyAbstract
The Free Nutritious Meals Program is currently one of the most talked about public policies, generating a wide range of responses from the public. One of the most active discussion forums is the social media platform TikTok, given that it has a large number of users and a relaxed and informal style of language. This study aims to examine public sentiment toward the MBG program through TikTok user comments, while also testing the performance of the K-Nearest Neighbor (KNN) algorithm in classifying sentiment as positive or negative. Research data was collected by crawling comments on several TikTok videos discussing Free Nutritious Meals during the period from September to November 2025. A total of 1,000 comments were obtained and then processed through data cleaning stages, such as data cleaning, case folding, normalization, tokenization, stopword removal, and stemming. To convert the text into numerical form, the Term Frequency–Inverse Document Frequency (TF-IDF) method was used. Meanwhile, sentiment labeling was done manually to maintain the quality of the training data. Model performance was evaluated using a confusion matrix with accuracy, precision, recall, and F1-score indicators. The test results showed that the best accuracy rate, which was 70.50%, was obtained at a K value of 4. From the sentiment analysis conducted, negative comments were found to outnumber positive sentiments. The criticism that emerged generally related to food quality and safety, inequality in program distribution, and a lack of transparency in information provided to the public. This study shows that the KNN algorithm is quite capable of being used for sentiment analysis on TikTok comment data, although it still has limitations in understanding the variety of informal language often used by users. Therefore, the results of this study are expected to provide public opinion-based input for policymakers, as well as a foundation for the development of sentiment analysis methods that are more suited to the characteristics of social media in future studies.
Downloads
References
[1] R. Wijaya and A. Suwandhi, “Sentimen Komentar Universitas Pelita Harapan Pada TikTok Menggunakan Metode K-Nearest Neighbor,” JDMIS J. Data Min. Inf. Syst., vol. 2, no. 1, pp. 26–36, Feb. 2024, doi: 10.54259/jdmis.v2i1.2418.
[2] F. Fieryando and B. Kristianto, “Analisis Sentimen Terhadap TikTok Shop Dengan K-Nearest Neighbor, Decision Tree, dan Naive Bayes,” J. Buana Inform., vol. 15, no. 01, pp. 21–29, 2024, doi: 10.24002/jbi.v15i1.8205.
[3] S. Jurnalis Pipin and H. Kurniawan, “Analisis Sentimen Kebijakan MBKM Berdasarkan Opini Masyarakat di Twitter Menggunakan LSTM,” J. SIFO Mikroskil, vol. 23, no. 2, pp. 197–208, 2022, doi: 10.55601/jsm.v23i2.900.
[4] P. Algoritma, N. Bayes, D. A. N. S. V. M. Dalam, M. Prediksi, K. Siswa, and D. I. Smk, “No Title,” vol. 2, no. April, pp. 38–45, 2023.
[5] R. Tangke, D. Tineke Salaki, W. Widsli Kalengkongan, and E. Ketaren, “Analisis Sentimen Aplikasi Tiktok Menggunakan Algoritma Support Vector Machine (Svm) Dan Random Forest,” J. TIMES, vol. 13, no. 2, pp. 53–62, 2024, doi: 10.51351/jtm.13.2.2024762.
[6] D. Ardiansyah, A. Saepudin, R. Aryanti, E. Fitriani, and Royadi, “Analisis Sentimen Review Pada Aplikasi Media Sosial Tiktok Menggunakan Algoritma K-Nn Dan Svm Berbasis Pso,” J. Inform. Kaputama, vol. 7, no. 2, pp. 233–241, 2023, doi: 10.59697/jik.v7i2.148.
[7] D. A. Lestari and D. Mahdiana, “Penerapan Algoritma K-Nearest Neighbor pada Twitter untuk Analisis Sentimen Masyarakat Terhadap Larangan Mudik 2021,” Inform. J. Ilmu Komput., vol. 17, no. 2, p. 123, 2021, doi: 10.52958/iftk.v17i2.3629.
[8] A. Halimi, K. Kusrini, and M. R. Arief, “Analisis Sentimen Masyarakat Indonesia Terhadap Pembelajaran Online Dari Di Media Sosial Twitter Menggunakan Lexicon Dan K-Nearest Neighbor,” COREAI J. Kecerdasan Buatan, Komputasi dan Teknol. Inf., vol. 2, no. 1, pp. 18–28, 2021, doi: 10.33650/coreai.v2i1.2283.
[9] N. Alvionika, S. Faisal, R. Rahmat, and A. F. N. Masruriyah, “Analisis Sentimen Pada Komentar Instagram Provider By.U Menggunakan Metode K-Nearest Neighbors (KNN),” J. Algoritm., vol. 21, no. 2, pp. 50–63, Nov. 2024, doi: 10.33364/algoritma/v.21-2.1672.
[10] Syahril Dwi Prasetyo, Shofa Shofiah Hilabi, and Fitri Nurapriani, “Analisis Sentimen Relokasi Ibukota Nusantara Menggunakan Algoritma Naïve Bayes dan KNN,” J. KomtekInfo, pp. 1–7, Jan. 2023, doi: 10.35134/komtekinfo.v10i1.330.
[11] I. Iwandini, A. Triayudi, and G. Soepriyono, “Analisa Sentimen Pengguna Transportasi Jakarta Terhadap Transjakarta Menggunakan Metode Naives Bayes dan K-Nearest Neighbor,” J. Inf. Syst. Res., vol. 4, no. 2, pp. 543–550, Jan. 2023, doi: 10.47065/josh.v4i2.2937.
[12] M. J. Palepa, N. Pratiwi, and R. Q. Rohmansa, “Analisis Sentimen Masyarakat Tentang Pengaruh Politik Identitas Pada Pemilu 2024 Terhadap Toleransi Beragama Menggunakan Metode K - Nearest Neighbor,” JIPI (Jurnal Ilm. Penelit. dan Pembelajaran Inform., vol. 9, no. 1, pp. 389–401, Feb. 2024, doi: 10.29100/jipi.v9i1.4957.
[13] N. Nur and F. Wajidi, “Analisis Sentimen Terhadap Komentar Game Mobile Legendsdi Play Store Dengan Menerapkan Metode K-Nearest Neighbors (KNN),” J. Peqguruang Conf. Ser., vol. 7, no. 1, 2025, doi: 10.35329/jp.v7i1.
[14] Pius Deski Manalu, Mutiara Simanjuntak, and Chairil Umri, “Implementasi Algoritma Klasifikasi untuk Analisis Sentimen Media Sosial Tiktok Tahun 2025,” J. Tek. Inform. dan Teknol. Inf., vol. 5, no. 1, pp. 488–504, 2025, doi: 10.55606/jutiti.v5i2.5644.
[15] R. Puspitasari, “Kebijakan Baru Skripsi Pada Media Sosial,” JEISBI Vol. 05 Number 03, 2024 (Journal Emerg. Inf. Syst. Bus. Intell., vol. 05, no. 03, pp. 37–42, 2024.
[16] R. K. Dinata, H. Akbar, and N. Hasdyna, “Algoritma K-Nearest Neighbor dengan Euclidean Distance dan Manhattan Distance untuk Klasifikasi Transportasi Bus,” Ilk. J. Ilm., vol. 12, no. 2, pp. 104–111, 2020, doi: 10.33096/ilkom.v12i2.539.104-111.
[17] D. Kartini, A. Farmadi, M. Muliadi, D. T. Nugrahadi, and P. Pirjatullah, “Perbandingan Nilai K pada Klasifikasi Pneumonia Anak Balita Menggunakan K-Nearest Neighbor,” J. Komputasi, vol. 10, no. 1, pp. 47–53, 2022, doi: 10.23960/komputasi.v10i1.2965.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Ivan Nugroho, Sri Mujiyono

This work is licensed under a Creative Commons Attribution-ShareAlike 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 a Creative Commons Attribution License (Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) ) that allows others to share the work with an acknowledgement 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 acknowledgement 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 (See The Effect of Open Access).








