Evaluasi Komparatif Algoritma Machine Learning dalam Analisis Sentimen Program Makan Bergizi Gratis di Media Sosial X
DOI:
https://doi.org/10.30865/jurikom.v13i3.9741Keywords:
Machine Learning, Sentiment Analysis, Random Forest, TF-IDF, Social Media X, Free Nutritious Meal ProgramAbstract
The analysis of public opinion on social media platforms through sentiment analysis plays a crucial role in understanding how the public responds to government policies, including the Free Nutritious Meal Program (MBG). However, the imbalanced nature of social media data and the use of informal language such as sarcasm pose challenges in the sentiment classification process. Therefore, this study aims to examine public perceptions of the MBG program on platform X while also evaluating the effectiveness of several machine learning algorithms in categorizing sentiment. The dataset used in this study consists of 2,000 comments collected between February and April 2026. The data were labeled using a lexicon-based approach and processed through preprocessing and feature extraction using TF-IDF. The classification process was carried out using six algorithms: Naïve Bayes, K-Nearest Neighbor (K-NN), Support Vector Machine (SVM), Decision Tree, Random Forest, and Logistic Regression. The results show that Random Forest achieved the highest accuracy, reaching 92%, supported by a cross-validation score of 89%, indicating strong model stability. Based on the classification results, public sentiment is predominantly neutral at 66.3%, followed by negative sentiment at 22.6% and positive sentiment at 11.1%. These findings suggest that public opinion toward the MBG program tends to be neutral, with a stronger inclination toward criticism than support. Furthermore, the results highlight the importance of selecting appropriate algorithms to improve the accuracy of sentiment analysis on complex and imbalanced textual data
References
[1] Krisnawan, Z. A. Rabbani, Trimono, and M. Idhom, “Analisis sentimen program makan bergizi gratis menggunakan bidirectional gated recurrent unit,” It-Explore, vol. 4, no. 3, pp. 282–294, 2025, doi: 10.24246/itexplore.v4i3.2025.pp282-294.
[2] Marlina dan Y. Yusuf, “ANALISIS EFEKTIVITAS PROGRAM MAKAN BERGIZI GRATIS DI SEKOLAH DASAR INDONESIA TAHUN 2025.pdf,” vol. 2, no. 2, pp. 2855–2866, 2025.
[3] I. Febryanti, I. Indiati, Pane, and P. Astuti, “Implementasi Kebijakan Makan Bergizi Gratis (MBG) Studi Kasus pada SDN 3 Kepanjen Kabupaten Malang,” Dialogue J. Ilmu Adm. Publik, vol. 7, no. 1, pp. 067–079, 2025, [Online]. Available: https://ejournal2.undip.ac.id/index.php/dialogue/article/view/26628
[4] S. D. Waluyo, “Kebijakan Makanan Bergizi Gratis: Tinjauan Ekonomi Politik Dalam Kesejahteraan Dan Ketahanan Pangan,” J. Ilm. Ilmu Adm. Negara, vol. 12, no. 1, pp. 2614–2945, 2025.
[5] A. S. Muliana, D. Lestarini, and S. P. Raflesia, “Analysis of Public Sentiment on Election Results using Naïve Bayes in Social Media X,” Sistemasi, vol. 13, no. 6, p. 2467, 2024, doi: 10.32520/stmsi.v13i6.4592.
[6] H. H. Limbong and N. N. Norhikmah, “Optimization of Sentiment Analysis for Amikom One Application Reviews Using SMOTE with Artificial Neural Network Algorithm,” Sistemasi, vol. 13, no. 5, p. 2048, 2024, doi: 10.32520/stmsi.v13i5.4437.
[7] A. F. Rizkyllah, A. Meiriza, and D. Y. Hardiyanti, “Comparative Study of KNN and SVM Methods for Analyzing College Major Consistency Based on High School Background,” J. Sisfokom (Sistem Inf. dan Komputer), vol. 14, no. 4, pp. 429–436, 2025, doi: 10.32736/sisfokom.v14i4.2521.
[8] I. N. Amalina, N. Norhikmah, and W. M. Ashari, “Analysis of the Performance Comparison between Random Forest and SVM RBF in Detecting Cyberbullying on Imbalanced Data with the SMOTE Approach,” Sistemasi, vol. 14, no. 6, p. 2768, 2025, doi: 10.32520/stmsi.v14i6.5574.
[9] D. Munandar, M. Afdal, Z. Zarnelly, and R. Novita, “Analisis Sentimen Ulasan Pengguna Aplikasi Mobile Banking Menggunakan Algoritma K-Nearest Neighbor,” J. Teknol. Sist. Inf. dan Apl., vol. 7, no. 3, pp. 1309–1318, 2024, doi: 10.32493/jtsi.v7i3.41409.
[10] A. T. Octa Nuryawan, M. Hasbullah, M. Rizal, M. F. Rajab, and N. Agustina, “Algoritma Decision Tree Untuk Analisis Sentimen Public Terhadap Marketplace Diindonesia,” Naratif J. Nas. Riset, Apl. dan Tek. Inform., vol. 5, no. 1, pp. 18–25, 2023, doi: 10.53580/naratif.v5i1.186.
[11] N. H. Nanda Dwi Kurniawan, Praditya Rendi Ferdian, “Analisis Sentimen Algoritma Naïve Bayes, Support Vector Machine, dan Random Forest Pada Ulasan Aplikasi Ajaib,” J. Nas. Tenknologi dan Sist. Inf., vol. 11, no. 1, pp. 087–097, 2024, doi: 10.25077/TEKNOSI.v11i1.2025.87-97.
[12] I. R. Ainunnisa and S. Sulastri, “Analisis Sentimen Aplikasi Tiktok dengan Metode Support Vector Machine (SVM), Logistic Regression dan Naïve Bayes,” J. Teknol. Sist. Inf. dan Apl., vol. 6, no. 3, pp. 423–430, 2023, doi: 10.32493/jtsi.v6i3.31076.
[13] L. Nursinggah, R. Ruuhwan, and T. Mufizar, “Analisis Sentimen Pengguna Aplikasi X Terhadap Program Makan Siang Gratis Dengan Metode Naïve Bayes Classifier,” J. Inform. dan Tek. Elektro Terap., vol. 12, no. 3, 2024, doi: 10.23960/jitet.v12i3.4336.
[14] N. Aditiya, P. Setiaji, and Supriyono, “Analisis Sentimen Kepuasan Masyarakat terhadap Aplikasi ‘INFO BMKG’menggunakan Naive Bayes, SVM, dan KNN,” Sist. J. Sist. Inf., vol. 14, no. 3, pp. 2540–9719, 2025, [Online]. Available: http://sistemasi.ftik.unisi.ac.id
[15] U. Farid, A. Faqihi, A. E. Pajri, and M. J. Vikri, “Analisis Perbandingan Algoritma SVM , Logistic Regression , Naive Bayes , dan XGBoost Untuk Deteksi Fake News,” vol. 13, no. 1, 2026, doi: 10.30865/jurikom.v13i1.9492.
[16] J. Friadi and D. E. Kurniawan, “Analisis Sentimen Ulasan Wisatawan Terhadap Alun-Alun Kota Batam: Perbandingan Kinerja Metode Naive Bayes dan Support Vector Machine,” J. Sist. Inf. Bisnis, vol. 14, no. 4, pp. 403–407, 2024, doi: 10.21456/vol14iss4pp403-407.
[17] F. Fahraini, “Analisis Sentimen Masyarakat Indonesia terhadap Keterlibatan Bill Gates dalam Program Vaksin TBC di Media Sosial X Menggunakan SVM,” vol. 13, no. 1, pp. 29–47, 2026, doi: 10.30865/jurikom.v13i1.9431.
[18] S. Nur, Z. Wati, and H. Darwis, “Naïve Bayes Classifier dan K-Nearest Neighbor pada Analisis Sentimen Perkuliahan Daring di Universitas Muslim Indonesia Naïve Bayes Classifier and K-Nearest Neighbor on Sentiment Analysis of Online Lectures at Universitas Muslim Indonesia,” vol. 5, no. 1, pp. 47–54, 2025.
[19] F. A. Larasati, D. E. Ratnawati, and B. T. Hanggara, “Analisis Sentimen Ulasan Aplikasi Dana dengan Metode Random Forest,” J. Pengemb. Teknol. Inf. dan Ilmu Komput., vol. 6, no. 9, pp. 4305–4313, 2022, [Online]. Available: http://j-ptiik.ub.ac.id
[20] D. Kurniawan, H. D. Purnomo, and A. Iriani, “Analisis Sentimen Komentar Konsumen Industri Jamu di Media Sosial menggunakan Artificial Neural Network dan K-Nearest Neighbor,” J. Sist. Inf. Bisnis, vol. 14, no. 3, pp. 210–223, 2024, doi: 10.21456/vol14iss3pp210-223.
[21] A. S. Rizkia, Wufron, and F. F. Roji, “Sentiment Analysis of Coretax: A Comparison of Manual, Transformers- Based, and Lexicon-Based Data Labeling on IndoBERT Performance,” MALCOM Indones. J. Mach. Learn. Comput. Sci., vol. 5, no. 3, pp. 1037–1048, 2025.
[22] Norhikmah, W. Nurastuti, A. Aminuddin, A. Sidauruk, and P. H. Gunawan, “Optimization and Collaboration of Fuzzy C-Mean, K-Mean, and Naïve Bayes Algorithms Using the Elbow Method for Micro, Small, and Medium Enterprises,” Int. J. Informatics Vis., vol. 9, no. 5, pp. 2062–2071, 2025, doi: 10.62527/joiv.9.5.3292.
[23] ISK Idris, YA Mustofa, and IA Salihi, “Analisis Sentimen Terhadap Penggunaan AplikasiShopee Mengunakan Algoritma Support VectorMachine (SVM),” Jambura J. Electr. Electron. Eng., vol. 5, no. 1, pp. 32–35, 2023.
[24] A. W. Nugroho and Norhikmah, “Analisis Sentimen menggunakan Algoritma Support Vector Machine pada Covid_19 Sentiment Analysis using the Support Vector Machine Algorithm on Covid_19,” J. Sist. Inf., vol. 13, no. 4, pp. 2540–9719, 2024, [Online]. Available: http://sistemasi.ftik.unisi.ac.id
[25] F. Qothrunnada et al., “Tone Detection On Teranika Musical Instrument Using Discrete Wavelet Transform And Decision Tree Classification” vol. 4, no. 2, pp. 373–380, 2023.
[26] I. Rahmawati, T. Rika Fitriani, A. No’eman, and A. Y. P. Yusuf, “Analisis Sentimen Menggunakan Algoritma Logistic Regression Pada Penerbangan Lion Air berdasarkan Ulasan Platform Online,” J. Ris. Inform. dan Teknol. Inf., vol. 1, no. 1, pp. 11–16, 2023, doi: 10.58776/jriti.v1i1.60.
[27] A. I. Kamil, O. N. Pratiwi, and D. Witarsyah, “Analisis Sentimen dan Pemodelan Topik terhadap Aplikasi Pembelajaran Online pada Platform Google Play,” JIPI (Jurnal Ilm. Penelit. dan Pembelajaran Inform., vol. 10, no. 2, pp. 836–849, 2025, doi: 10.29100/jipi.v10i2.6023.
[28] A. Sagita et al., “Penerapan Metode Random Forest Dalam Menganalisis,” vol. 7, no. 6, pp. 3307–3313, 2023.



