Perbandingan Algoritma Support Vector Machine dan Random Forest untuk Analisis Sentimen terkait Makan Bergizi Gratis (MBG)
DOI:
https://doi.org/10.37859/jf.v16i2.11363
Abstract
Advances in digital technology have made social media the primary platform for the public to voice their opinions on government policies, including the Free Nutritious Meals (MBG) program. This study aims to compare the performance of the Support Vector Machine (SVM) and Random Forest algorithms in conducting sentiment analysis of public opinion on the X platform regarding this policy, in order to provide an objective overview for policymakers. A total of 2,164 tweets were collected via crawling using Tweet Harvest from May to August 2025. The methodological steps included preprocessing, BERT-based automatic labeling, Eliminate the neutral class to focus the analysis on binary classification (positive and negative), TF-IDF feature extraction, and the application of SMOTE to address class imbalance in the dataset. Model optimization was performed using Grid Search with a 5-Fold Cross Validation testing scheme and an 80:20 data split. The results of the study indicate that the majority of public responses to the MBG program were positive. Based on the final evaluation, the SVM with a linear kernel proved superior with an accuracy of 78.24% and a macro average F1-score of 0.76, outperforming the Random Forest (300 estimators), which achieved an accuracy of 75.00% and an F1-score of 0.73. The application of SMOTE has proven to be crucial in improving the negative class recall, enabling the model to identify minority sentiments more accurately. This study concludes that SVMs demonstrate more stable and objective generalization capabilities in mapping public opinion following data balancing.
Downloads
References
K. H. Prastiawan and D. Yuniarto, “Analisis Sentimen Publik terhadap Program Makan Bergizi Gratis dengan Algoritma Naive Bayes,” RIGGS: Journal of Artificial Intelligence and Digital Business, vol. 4, no. 4, pp. 5412–5419, Dec. 2025, doi: 10.31004/riggs.v4i4.3652.
V. Rizqika, P. Handoko, and A. Rochmania, “Self disclosure generasi z melalui media x (twitter),” Jurnal Ilmu Komunikasi UHO : Jurnal Penelitian Kajian Ilmu Komunikasi dan Informasi, vol. 10, no. 2, pp. 397–411, 2025, doi: 10.52423/jikuho.v10i2.348.
simon Kemp, “Digital 2024: Indonesia,” 2024. [Online]. Available: https://datareportal.com/reports/digital-2024-indonesia
S. D. Waluyo, “Kebijakan makanan bergizi gratis: tinjauan ekonomi politik dalam kesejahteraan dan ketahanan pangan,” 2025, doi: http://dx.doi.org/10.25157/dak.v12i1.18223.
Associated press, “Indonesia launches free meals program to feed children and pregnant women to fight malnutrition.” [Online]. Available: https://apnews.com/article/indonesia-prabowo-subianto-free-meals-children-mothers-213a04587203434f3f85950725e84a8b
BBC, “Anggaran MBG sebesar Rp335 triliun digugat ke MK karena ‘memakan’ sepertiga dana pendidikan-Seberapa mungkin dikabulkan hakim?,” 2026. [Online]. Available: https://www.bbc.com/indonesia/articles/cn42dl7wykpo
I. F. Rahman, A. N. Hasanah, and N. Heryana, “Analisis sentimen ulasan pengguna aplikasi samsat digital nasional (signal) dengan menggunakan metofe naive bayes classifier,” Jurnal Informatika dan Teknik Elektro Terapan, vol. 12, no. 2, Apr. 2024, doi: 10.23960/jitet.v12i2.4073.
M. R. Adrian, M. P. Putra, M. H. Rafialdy, and N. H. Rakhmawati, “Perbandingan Metode Klasifikasi Random Forest dan Svm pada analisis sentimen PSBB,” 2021, doi: 10.26877/jiu.v7i1.7099.
P. Kumala Sari and R. Randy Suryono, “Komparasi algoritma support vector machine dan random forest untuk analisis sentimen metaverse,” 2024. doi: https://doi.org/10.36040/mnemonic.v7i1.8977.
A. Rahman Isnain, A. Indra Sakti, D. Alita, and N. Satya Marga, “Sentimen analisis publik terhadap kebijakan lockdown pemerintah jakarta menggunakan algoritma svm,” JDMSI, vol. 2, no. 1, pp. 31–37, 2021, doi: https://doi.org/10.33365/jdmsi.v2i1.1021.
N. Sakina, F. Wajidi, and Muh. R. Rasyid, “Evaluasi Algoritma KNN dan Naive Bayes untuk Analisis Sentimen Kebijakan Program Makan Bergizi Gratis,” Jambura Journal of Informatics, vol. 1, no. 2, pp. 83–97, Oct. 2025, doi: 10.37905/jji.v1i2.34418.
A. Ilham and W. Pramusinto, “Analisis sentimen masyarakat terhadap kesehatan mental pada twitter menggunakan algoritma k-nearest neighbor,” 2023, Accessed: Mar. 30, 2026. [Online]. Available: https://senafti.budiluhur.ac.id/senafti/article/view/792
O. I. Gifari, M. Adha, I. Rifky Hendrawan, F. Freddy, and S. Durrand, “Analisis Sentimen Review Film Menggunakan TF-IDF dan Support Vector Machine,” JIFOTECH (JOURNAL OF INFORMATION TECHNOLOGY, vol. 2, no. 1, 2022, doi: 10.46229/jifotech.v2i1.330.
Y. Ansori and K. F. H. Holle, “Perbandingan Metode Machine Learning dalam Analisis Sentimen Twitter,” Jurnal Sistem dan Teknologi Informasi (JustIN), vol. 10, no. 4, p. 429, Dec. 2022, doi: 10.26418/justin.v10i4.51784.
H. Harnelia and A. Saputra, “Analisis sentimen review skincare skintific dengan algoritma support vector machine (svm),” Jurnal Informatika dan Teknik Elektro Terapan, vol. 12, no. 2, Apr. 2024, doi: 10.23960/jitet.v12i2.4095.
H. Al Rasyid Harpizon et al., “Analisis Sentimen Komentar Di YouTube Tentang Ceramah Ustadz Abdul Somad Menggunakan Algoritma Naïve Bayes,” Jurnal Nasional Komputasi dan Teknologi Informasi, vol. 5, no. 1, 2022, doi: 10.32672/jnkti.v5i1.4008.
R. Merdiansah and A. Ali Ridha, “Analisis Sentimen Pengguna X Indonesia Terkait Kendaraan Listrik Menggunakan IndoBERT,” Jurnal Ilmu Komputer dan Sistem Informasi (JIKOMSI, vol. 7, no. 1, pp. 221–228, 2024, doi: https://doi.org/10.55338/jikomsi.v7i1.2895.
R. Rahmadani, A. Rahim, and R. Rudiman, “Analisis sentimen ulasan ‘ojol the game’di google play store menggunakan algoritma naive bayes dan model ektraksi fitur tf-idf untuk meningkatkan kualitas game,” Jurnal Informatika dan Teknik Elektro Terapan, vol. 12, no. 3, Aug. 2024, doi: 10.23960/jitet.v12i3.4988.
C. Candra, K. W. Chandra, and H. Irsyad, “Efektifitas SMOTE dalam Mengatasi Imbalanced Class Algoritma K-Nearest Neighbors pada Analisis Sentimen terhadap Starlink,” Jurnal Ilmu Komputer dan Informatika, vol. 4, no. 1, pp. 31–42, Jul. 2024, doi: 10.54082/jiki.132.
M. Fajri and A. Primajaya, “Komparasi Teknik Hyperparameter Optimization pada SVM untuk Permasalahan Klasifikasi dengan Menggunakan Grid Search dan Random Search,” 2023. doi: https://doi.org/10.30871/jaic.v7i1.5004.
P. D. Santoso and W. Wibowo, “Analisis Sentimen Ulasan Aplikasi Buzzbreak Menggunakan Metode Naïve Bayes Classifier pada Situs Google Play Store,” 2022. doi: 10.12962/j23373520.v11i2.72534.
S. D. Wahyuni and R. H. Kusumodestoni, “Optimalisasi Algoritma Support Vector Machine (SVM) Dalam Klasifikasi Kejadian Data Stunting,” Bulletin of Information Technology (BIT), vol. 5, no. 2, pp. 56–64, 2024, doi: 10.47065/bit.v5i2.1247.
L. Sari, A. Romadloni, and R. Listyaningrum, “Penerapan Data Mining dalam Analisis Prediksi Kanker Paru Menggunakan Algoritma Random Forest,” Infotekmesin, vol. 14, no. 1, pp. 155–162, Jan. 2023, doi: 10.35970/infotekmesin.v14i1.1751.
G. Rininda, I. H. Santi, and S. Kirom, “Penerapan svm dalam analisis sentimen pada edlink menggunakan pengujian confusion matrix,” Jurnal Mahasiswa Teknik Informatika, vol. 7, no. 5, 2023, doi: 10.36040/jati.v7i5.7420.
D. A. Sani and M. Z. Sarwani, “A Random Oversampling and BERT-based Model Approach for Handling Imbalanced Data in Essay Answer Correction,” vol. 16, no. 4, pp. 729–739, 2024, doi: 10.20895/INFOTEL.V16I3.1224.
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Alfian Saputra, Nuralamsah Zulkarnaim, Farid Wajidi

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Copyright Notice
An author who publishes in the Jurnal FASILKOM (teknologi inFormASi dan ILmu KOMputer) agrees to the following terms:
- Author retains the copyright and grants the journal the right of first publication of the work simultaneously licensed under the Creative Commons Attribution-ShareAlike 4.0 License that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal
- Author is 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 the acknowledgement of its initial publication in this journal.
- Author is permitted and encouraged to post his/her 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 the published work (See The Effect of Open Access).
Read more about the Creative Commons Attribution-ShareAlike 4.0 Licence here: https://creativecommons.org/licenses/by-sa/4.0/.


