A Performance Comparison of Machine Learning Algorithms in Text Analysis of the Free Lunch Program
DOI:
https://doi.org/10.57152/predatecs.v4i1.2093Keywords:
Free Lunch Program, Machine Learning, Natural Language Processing, Public Opinion, Sentiment AnalysisAbstract
The rise of public discourse on social policies in digital platforms necessitates accurate sentiment analysis to support data-driven policymaking. This study investigates the performance of three machine learning algorithms, Naive Bayes, Random Forest, and Support Vector Machine (SVM), in classifying public sentiment toward Indonesia’s Free Lunch Program. Data were collected via web scraping of YouTube comment sections, preprocessed with standard Natural Language Processing (NLP) techniques, and transformed with TF-IDF vectorization. Each algorithm was evaluated using accuracy, precision, recall, and F1-score on a three-class sentiment classification task with classes positive, neutral, and negative. Results show that Random Forest outperformed the other models with an accuracy of 93.55%, followed by SVM at 82.54%, and Naive Bayes at 75.71%. Random Forest demonstrated strong consistency across all sentiment categories, while SVM also delivered competitive results, especially for neutral sentiment. Naive Bayes, although efficient, struggled with imbalanced data, particularly in detecting negative sentiment. These findings highlight the superiority of ensemble models, such as Random Forest, in handling complex sentiment tasks and provide a foundation for developing robust NLP-based public opinion analysis tools for social policy evaluation. Unlike previous studies that primarily focused on product reviews or political sentiment, this research provides a comparative evaluation of machine learning algorithms for analyzing public opinion on Indonesia's Free Lunch Program using YouTube comments. The findings contribute practical guidance for selecting appropriate sentiment classification models to support evidence-based public policy evaluation
References
M. Furqan and A. F. A. Nasir, “Big data approach to sentiment analysis in machine learning-based microblogs: Perspectives of religious moderation public policy in Indonesia,” Journal of Applied Engineering, 2024.
M. Hadwan, M. Al-Sarem, F. Saeed, and M. A. Al-Hagery, “Sentiment classification for measuring user satisfaction toward governmental services using machine learning,” Applied Sciences, vol. 12, no. 11, p. 5547, 2022.
Z. Zakaria and K. Kusrini, “Sentiment Analysis to Measure Public Trust in the Government Due to the Increase in Fuel Prices Using Naive Bayes and SVM,” International Journal of Artificial Intelligence Research, 2023.
E. S. Negara, R. Syaputra, and D. Erlansyah, “Sentiment Analysis on Presidential Advisory Appointments Using Naive Bayes,” Jurnal Ilmiah Ilmu Teknik, 2024.
A. K. Darmawan, M. W. Al Wajieh, and M. B. Setyawan, “Hoax news analysis for the Indonesian capital relocation policy with SVM and RF,” Journal of Information System & Informatics, 2023.
F. Fauzi, W. Setiayani, and T. W. Utami, “Comparison of RF and NB Methods in Sentiment Analysis on Climate Change Issue,” Barekeng: Journal of Mathematics and Its Applications, 2023.
T. A. Khan, Z. Shahid, and M. M. Alam, “Sentiment analysis using support vector machine and random forest,” Journal of Informatics and Web Engineering, 2024.
E. Sihombing, M. H. Dar, and F. A. Nasution, “Comparison of ML Algorithms in Public Sentiment Analysis of TAPERA Policy,” International Journal of Science, Technology and Management, 2024.
G. Hristova, B. Bogdanova, and N. Netov, “Data mining of public opinion: An overview,” AIP Conference Proceedings, vol. 2505, no. 1, p. 020004, 2022.
H. Adamu, S. L. Lutfi, N. H. A. H. Malim, R. Hassan, and A. Di Vaio, “Framing Twitter Sentiment on Nigerian Government COVID-19 Palliatives,” Sustainability, vol. 13, no. 6, p. 3497, 2021.
M. R. Ramadhan and K. Budiman, “Sentiment Analysis of Presidential Candidates: SVM vs RF with N-Gram,” Recursive Journal of Informatics, 2025.
J. Andoh, L. Asiedu, and A. Lotsi, “Statistical Analysis of Public Sentiment on the Ghanaian Government,” Advances in Human-Computer Interaction, vol. 2021, Article ID 5561204, 2021.
Y. Qi and Z. Shabrina, “Sentiment Analysis Using Twitter Data: Lexicon vs ML-based,” Social Network Analysis and Mining, vol. 13, Article 30, 2023.
S. Rahayu and M. S. Hasibuan, “Sentiment Analysis of Mobile Banking Reviews Using Machine Learning Models,” 2025.
R. R. Pratama and R. R. Suryono, “Performance Comparison of Naive Bayes, Support Vector Machine, and Random Forest Algorithms for Apple Vision Pro Sentiment,” 2025.
S. Indhumathi and F. M. H. Fernandez, “Evaluating Sentiment Analysis Algorithms with Varied Datasets: A Machine Learning Approach,” IEEE, 2024.
R. Alhejaili, “Machine Learning Approaches for Sentiment Analysis on Social Media,” Springer, 2025.
R. Shad, K. Potter, and A. Gracias, “Sentiment Analysis Models: From Naive Bayes to Random Forest and Beyond,” Int. J. Artif. Intell. Mach. Learn., 2025.
S. E. Chavan, A. D. Ambhure, and M. H. Karche, “Sentimental Analysis of Product Review using Machine Learning,” 2025.
P. Awasthi, M. Thomas, and D. Junghare, “A Machine Learning Framework for Failure Mode Identification from Warranty Data,” IEEE, 2025.
Alhagree and G. Al-Gaphari, “Utilizing Machine Learning based on LLM for Arabic Sentiment Analysis in Mobile Banking,” 2025.
S. Kamali, V. Jeeva, S. BharathKumar, et al., “Safeguarding Online Interaction: Utilizing Machine Learning for Detection of Malicious Intent,” IEEE, 2024.
M. Irvan and A. S. Venkatesam, “Sentiment Analysis of Movie Reviews: Optimizing Predictions Through TF-IDF Vectorization,” IEEE, 2025.
A. Durdu, Ö. Ko?ar, and C. T. Akpinar, “Enhancing the Performance of Machine Learning Classification Models,” IEEE, 2025.
R. Pandey, P. K. Patidar, and P. Verma, “A Comparative Study of Random Forest, SVM, and Naive Bayes for Sentiment Analysis Optimization,” IEEE, 2024.
K. D. Tania, M. Idris, and A. Rifai, “Sentiment Analysis of Tokopedia App Reviews using Machine Learning and Word Embeddings,” 2025.
S. Hossain, M. T. Siddique, and M. M. Hosen, “Comparative Analysis of Sentiment Analysis Models for Consumer Feedback,” 2025.
D. B. Reynaldi and R. R. Suryono, “Comparison of Accuracy of Various Text Classification Methods in Sentiment Analysis of E-Stamps,” 2025.
A. A. Fauzi, A. V. Vitianingsih, S. Kacung, and A. L. Maukar, “Sentiment Analysis On Tripadvisor Travel Agent Using Random Forest, SVM, and Naive Bayes,” 2025.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Juanda Alra Baye, Erliandika Syahputra, Hilmy Abdurrahim, Abid Aziz Adinda, Muhammad Rakha Athallah, Muhammad Zahid Ramadhan

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Copyright © by Author; Published by Institut Riset dan Publikasi Indonesia (IRPI)
This Public Research Journal of Engineering, Data Technology and Computer Science is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.









