Analisis Sentimen Persepsi Publik Terhadap Program MBG Pada Komentar YouTube Menggunakan Naïve Bayes dan Resampling
Abstract
The Free Nutritious Meal Program (MBG), launched by the Indonesian government in 2025, has generated diverse public responses on social media, particularly on YouTube as an open digital discussion space. This study aims to analyze public perception of the MBG program through sentiment classification of YouTube comments using the Multinomial Naïve Bayes algorithm combined with Term Frequency–Inverse Document Frequency (TF-IDF) weighting. The dataset consists of 1,082 comments categorized into three sentiment classes: negative, neutral, and positive. The data distribution reveals significant class imbalance, with negative sentiment dominating at 70.61%. The baseline model achieved an accuracy of 70.67% with a macro F1-score of 27.60%, indicating bias toward the majority class. To address this imbalance, Random Oversampling (ROS) and Synthetic Minority Over-sampling Technique (SMOTE) were applied. Although overall accuracy decreased to approximately 51% after resampling, the macro F1-score improved to 36.24% (SMOTE) and 37.09% (ROS), indicating enhanced performance in detecting minority classes. In the context of public policy evaluation, improved sensitivity to minority sentiment is considered more representative than high but biased accuracy. These findings highlight the importance of handling class imbalance in social media–based sentiment analysis for public policy monitoring.
Downloads
References
A. Wulandari, “Model Kyushoku Jepang dan Tantangan Implementasi Program Makan Bergizi Gratis di Indonesia,” J. Pendidik. Tambusai, vol. 9, no. 1, pp. 6948–6956, 2025, [Online]. Available: https://jptam.org/index.php/jptam/issue/view/30
R. Rimbawan, R. Nurdiani, P. H. Rachman, Y. Kawamata, and Y. Nozawa, “School Lunch Programs and Nutritional Education Improve Knowledge, Attitudes, and Practices and Reduce the Prevalence of Anemia: A Pre-Post Intervention Study in an Indonesian Islamic Boarding School,” Nutrients, vol. 15, no. 4, 2023, doi: 10.3390/nu15041055.
R. Nida and D. D. P. Sari, “School Meals Program and Its Impact Towards Student’s Cognitive Achievement,” J. Econ. Res. Soc. Sci., vol. 7, no. 1, pp. 69–80, 2023, doi: https://doi.org/10.18196/jerss.v7i1.17014.
M. A. Muafa, C. Wahyudin, E. Salbiah, and O. Subagdja, “Efektivitas Program Pemberian Makanan Tambahan Pada Anak Stunting,” Karimah Tauhid, vol. 3, no. 4, pp. 4947–4953, 2024, doi: https://doi.org/10.30997/karimahtauhid.v3i4.12978.
A. Kusuma and A. Nugroho, “Analisa Sentimen Pada Twitter Terhadap Kenaikan Tarif Dasar Listrik Dengan Metode Naïve Bayes,” J. Ilm. Teknol. Inf. Asia, vol. 15, no. 2, pp. 137–146, 2021, doi: 10.32815/jitika.v15i2.557.
C. A. Wicaksana, M. Fatkhurrokhman, H. P. Pratama, R. Tryawan, Alimuddin, and R. Febriani, “Twitter Sentiment Analysis in Indonesian Language using Naive Bayes Classification Method,” Proc. 2022 Int. Conf. Informatics, Electr. Electron., pp. 282–287, 2022, doi: 10.1109/ICIEE55596.2022.10010002.
I. Permana and K. D. Maani, “Publication Trend of Public Sentiment Towards Indonesia Government Policies,” Sinkron, vol. 8, no. 3, pp. 2061–2069, 2024, doi: 10.33395/sinkron.v8i3.13843.
A. Y. Pratama, G. A. Sanjaya, N. K. Lubis, and M. R. Aditya, “Analisis Sentimen Publik Terkait Danantara Menggunakan Algoritma IndoBERT pada Platform Media Sosial,” METIK J., vol. 9, no. 1, 2025, doi: 10.47002/metik.v9i1.1055.
M. Zhikri and W. Istiono, “Handling Class Imbalance for Indonesian Twitter Sentiment Analysis A Comparative Study of Algorithms,” J. Syst. Manag. Sci., vol. 14, no. 10, pp. 170–179, 2024, doi: 10.33168/jsms.2024.1010.
M. Al, G. Muttaqin, and G. A. Trisnapradika, “Optimasi Algoritma SVM dengan Teknik SMOTE dan Tuning Parameter pada Klasifikasi Balita Stunting,” Build. Informatics, Technol. Sci., vol. 7, no. 3, pp. 1547–1556, 2025, doi: 10.47065/bits.v7i3.8330.
Bahrun and Wildan, “Stunting in Indonesian Children and Its Contributing Factors: Study through Bibliometric Analysis,” JPUD - J. Pendidik. Usia Dini, vol. 16, no. 2, pp. 271–293, 2022, doi: 10.21009/jpud.162.07.
A. Alrehaili, A. Alsaeedi, and W. M. S. Yafooz, “Sentiment analysis of YouTube videos comments for children using machine learning and deep learning,” Indones. J. Electr. Eng. Comput. Sci., vol. 40, no. 1, pp. 397–410, 2025, doi: 10.11591/ijeecs.v40.i1.pp397-410.
R. Rahmatulloh, M. I. Ibrahim, and M. R. Handayani, “Model Klasifikasi Naive Bayes untuk Pemetaan Persepsi Publik Secara Real-Time pada Media Sosial : Studi Kasus RUU TNI 2025,” J. Pendidik. Teknol. Inf., vol. 5, no. 2, pp. 365–379, 2025, doi: http://dx.doi.org/10.51454/decode.v5i2.1139.
M. K. F. Mawar Hardiyanti, “Optimasi Analisis Sentimen Komentar Penonton Wayang Digital dengan SMOTE dan Algoritma Naïve Bayes Optimizing Sentiment Analysis of Digital Wayang Viewer Comments using SMOTE and the Naïve Bayes Algorithm,” J. Sist. Inf., vol. 14, no. 3, pp. 1154–1164, 2025, doi: https://doi.org/10.32520/stmsi.v14i3.
Y. A. Mahmood and B. Mahmood, “A Web Scraper for Data Mining Purposes,” Sistemasi, vol. 13, no. 3, p. 1243, 2024, doi: 10.32520/stmsi.v13i3.4107.
I. R. I. A. Arrizqi Fauzy Aufar, Mochamad Alfan Rosid, Ade Eviyanti, “Optimizing Text Preprocessing fors Accurate Sentiment Analysis on E-Wallet Reviews,” J. Inf. Comput. Technol. Educ., vol. 7, no. 2, pp. 42–50, 2023, doi: 10.21070/jicte.v7i2.1650.
A. S. N. Handoko, A. Asrofiq, Junadhi, “Sentiment Analysis of Sirekap Tweets Using CNN Algorithm,” J. Ilm. Penelit. dan Penerapan Teknol. Sist. Inf., vol. 8, no. 2, pp. 312–329, 2024, doi: https://doi.org/10.29407/intensif.v8i2.23046.
L. Ellyanti, Y. Ruldeviyani, L. E. Pradana, and A. Harjanto, “Sentiment Analysis of Twitter Users to the PeduliLindungi Using Naïve Bayes Algorithm,” Rekayasa Sist. dan Teknol. Inf., vol. 7, no. 2, pp. 414–421, 2023, doi: https://doi.org/10.20473/jisebi.9.1.101-110.
D. A. P. R. D. Ni Wayan Sumartini Saraswati, Christina Purnama Yanti, I Dewa Made Krihna Muku, “Evaluation Analysis of the Necessity of Stemming and Lemmatization in Text Classification,” vol. 24, no. 2, pp. 321–332, 2025, doi: 10.30812/matrik.v24i2.4833.
J. A. Putra, A. Dharmawan, and J. Gondohanindijo, “Sentimen Analisis Aplikasi Digitalent Mobile Menggunakan Naïve Bayes dan Svm dengan Ekstraksi Fitur TF-IDF,” J. Inf. Technol. Comput. Sci., vol. 7, no. 4, pp. 1139–1148, 2024, doi: https://doi.org/10.31539/intecoms.v7i4.
C. S. Wildanil Ghozi1, Jasim Nadheer Hussein , Ramadhan Rakhmat Sani , Fauzi Adi Rafrastara , Cinantya Paramita, “Mitigating Class Imbalance in DDoS Detection : The Impact of Random Over Sampling on Machine Learning Performance,” ELKHA J. Tek. Elektro, vol. 17, no. 2, pp. 109–117, 2025, doi: https://doi.org/10.26418/elkha.v17i2.84652.
W. B. Zulfikar, A. R. Atmadja, and S. F. Pratama, “Sentiment Analysis on Social Media Against Public Policy Using Multinomial Naive Bayes,” Sci. J. Informatics, vol. 10, no. 1, pp. 25–34, 2023, doi: 10.15294/sji.v10i1.39952.
Bila bermanfaat silahkan share artikel ini
Berikan Komentar Anda terhadap artikel Analisis Sentimen Persepsi Publik Terhadap Program MBG Pada Komentar YouTube Menggunakan Naïve Bayes dan Resampling
Pages: 2467−2478
Copyright (c) 2026 Lutfi Najib, Adzhal Arwani Mahfudh, Syaiful Bakhri

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).





















