Komparasi Kinerja Algoritma Machine Learning Untuk Analisis Sentimen Multi-Kelas Pada Data Teks Digital Terhadap Kebijakan Pemerintah

Sestri Noviarizki, Sunardi Sunardi, Herman Yuliansyah

Abstract

The development of social media and digital platforms has increased the number of public opinions on various government policies, including the Free Nutritional Meals (MBG) program. Digital text data generated by the public contains important information regarding public perceptions and sentiments, however  the characteristics of unstructured data and large data volumes pose challenges in the analysis process. In addition, the integrity of class sentiment can also affect the performance of model classification. This study aims to compare the performance of several Machine Learning algorithms, namely Naive Bayes, Support Vector Machine (SVM), Random Forest, Decision Tree, and K-Nearest Neighbors (KNN) in multi-class sentiment analysis classification on digital text data related to the MBG program. The dataset used is 4,969 text data from Kaggle in the form of public comments on social media related to government policies. The research method is through data collection, text preprocessing, TF-IDF feature weighting, model training, and evaluation using a confusion matrix, accuracy, precision, recall, and F1-score. The preprocessing stages include case folding, tokenizing, stopword removal, and stemming to clean and normalize the text data. Sentiment classification was performed into three categories: positive, negative, and neutral. The results showed that the Random Forest algorithm performed best with an accuracy of 0.81, compared to SVM (0.77), Decision Tree (0.75), Naive Bayes (0.71), and K-Nearest Neighbors (KNN) (0.52). Furthermore, Random Forest also produced higher precision, recall, and F1-score values for most sentiment classes, making it more effective in recognizing sentiment patterns in digital text data on government policies related to the MBG program.

Keywords

Machine Learning; Sentiment Analysi, Teks Digita; Social Media; Algoritma

Full Text:

PDF

References

Abdillah, T. F., Hasmawati, H., & Bunyamin, B. (2024). Comparison of TF-IDF and GloVe Word Embedding for Sentiment Analysis of 2024 Presidential Candidates. Building of Informatics, Technology and Science (BITS), 6(2), 961–969. https://doi.org/10.47065/bits.v6i2.5668

Alfaridzy, M. A., Haerani, E., Jasril, & Oktavia, L. (2025). keuangan negara . Secara umum , efisiensi anggaran merujuk pada kemampuan pemerintah dalam pemerintahan ( Alfandi Safira & Hasan , 2023 ). yang dominan dalam masyarakat ( Doloksaribu & Yusran Timur Samuel , 2022 ). Salah satu metode yang efektif untuk mel. 6, 169–182.

Ardiansyah, R., Yuliansyah, H., & Yudhana, A. (2025). Multi-Label Opinion Mining Based on Random Forest with SMOTE and ADASYN. Compiler, 14(2), 65–75. https://doi.org/10.28989/compiler.v14i2.3185

Chicco, D., Warrens, M. J., & Jurman, G. (2021). The coefficient of determination R-squared is more informative than SMAPE, MAE, MAPE, MSE and RMSE in regression analysis evaluation. PeerJ Computer Science, 7, e623. https://doi.org/10.7717/peerj-cs.623

Damayanti, L., & Lhaksmana, K. M. (2024). Sentiment Analysis of the 2024 Indonesia Presidential Election on Twitter. Sinkron, 8(2), 938–946. https://doi.org/10.33395/sinkron.v8i2.13379

Dasriani, N. G. A., Pariandi, L. A. G., & Dharma, I. M. Y. (2024). Analisis Sentimen Program Jaminan Kesehatan Nasional Menggunakan Multiclass Support Vector Machine. BIOS : Jurnal Teknologi Informasi Dan Rekayasa Komputer, 6(1), 20–30. https://doi.org/10.37148/bios.v6i1.136

Dietterich, T. G., & Bakiri, G. (1995). Solving Multiclass Learning Problems via Error-Correcting Output Codes. Journal of Artificial Intelligence Research, 2, 263–286. https://doi.org/10.1613/jair.105

Elinda, E., Yuliansyah, H., & Latiffi, M. I. A. (2024). Sentiment Analysis of the Sheikh Zayed Grand Mosque’s Visitor Reviews on Google Maps Using the VADER Method. International Journal of Advances in Data and Information Systems, 5(1), 71–84. https://doi.org/10.59395/ijadis.v5i1.1320

Fauzi, R. H., Kusumah, K., & Rahmatulloh, A. (2026). Analisis Sentimen Media Sosial Terhadap DPR RI : Perbandingan Akurasi Extra Trees Dan Random Forest Dengan Pendekatan Komputasi Hijau Sentiment Analysis of Social Media Towards DPR RI : Accuracy Comparison of Extra Trees and Random Forest with a Green Com. 14(1), 36–45. https://doi.org/10.26418/justin.v14i1.92556

Harun, R. M., & Fahmi, F. (2024). Analisis Sentimen Menggunakan Algoritma Naïve Bayes, KNN, dan Decision Tree Terhadap Ulasan Aplikasi KitaLulus. Building of Informatics, Technology and Science (BITS), 6(3), 2033–2042. https://doi.org/10.47065/bits.v6i3.6367

Harwenda, R. W., Angelo, M. D., Budi, I., Santoso, A. B., & Putra, P. K. (2025). Sentiment Analysis on Government Public Policies: A Systematic Literature Review. Dinasti International Journal of Education Management And Social Science, 6(5), 4192–4211. https://doi.org/10.38035/dijemss.v6i5.4699

Hetherington, M. J. (2025). The Presidential Election: The Elections of 2024, 9(1), 68–93. https://doi.org/10.2307/jj.28833768.6

Keladu, Y., Darling, D., Sugar, F., & Armansi, A. (2026). Program Makan Bergizi Gratis (MBG) di Era Kepemimpinan Prabowo-Gibran dalam Perspektif Amartya Sen. Politeia: Jurnal Ilmu Politik, 18(1), 1–8. https://doi.org/10.32734/politeia.v18i1.20855

Leidiyana, H., Misriati, T., & Aryanti, R. (2024). Klasifikasi Sentimen Terhadap Kebijakan Tapera Menggunakan Komparasi Machine Learning dan SMOTE. Jurnal Komtika (Komputasi Dan Informatika), 8(2), 125–135. https://doi.org/10.31603/komtika.v8i2.12595

Lestari, V. B., & Hutagalung, C. A. (2025). Evaluation of TF-IDF Extraction Techniques in Sentiment Analysis of Indonesian-Language Marketplaces Using SVM, Logistic Regression, and Naive Bayes. Journal of Computer Science and Applications, 8(1), 22–2025.

Lillah, M. R. R., Maylawati, D. S., Zulfikar, W. B., Uriawan, W., & Wahana, A. (2023). Implementasi Algoritma K-Nearest Neighbor (KNN) untuk analisis sentimen pengguna aplikasi Tokopedia. Intellect : Indonesian Journal of Learning and Teachnological Innovation, 02(02), 171–184.

Muhidin, D., & Wibowo, A. (2020). Perbandingan Kinerja Algoritma Support Vector Machine dan K-Nearest Neighbor Terhadap Analisis Sentimen Kebijakan New Normal. STRING (Satuan Tulisan Riset Dan Inovasi Teknologi), 5(2), 153. https://doi.org/10.30998/string.v5i2.6715

Nur Cahyo, D. D., Farasalsabila, F., Lestari, V. B., Hanafi, Lestari, T., Al Islami, F. R., & Maulana, M. A. (2023). Sentiment Analysis for IMDb Movie Review Using Support Vector Machine (SVM) Method. Inform : Jurnal Ilmiah Bidang Teknologi Informasi Dan Komunikasi, 8(2), 90–95. https://doi.org/10.25139/inform.v8i2.5700

Panjaitan, F., Ce, W., Oktafiandy, H., Kanugrahan, G., Ramdhani, Y., Hafizh Cahaya Putra, V., & Permai, A. (2025). Studi Komparatif Algoritma Machine Learning Pada Analisis Sentimen Media Sosial. JATI (Jurnal Mahasiswa Teknik Informatika), 9(2), 3145–3152. https://doi.org/10.36040/jati.v9i2.13277

Prasetyoningrum, D., & Andono, P. N. (2024). Perbandingan Model Machine Learning dalam Analisis Sentimen Pada Kasus Monkeypox di Media Sosial X. Building of Informatics, Technology and Science (BITS), 6(3), 2005–2014. https://doi.org/10.47065/bits.v6i3.6447

Rahman, F. N., & Lestari, S. (2024). Analisis Sentimen Masyarakat Terhadap Pemerintah di Era Kabinet Joko Widodo Berdasarkan Sosial Media X Menggunakan Naïve bayes dan K-Nearest Neighbor (KNN). INTECOMS: Journal of Information Technology and Computer Science, 7(5), 1537–1544. https://doi.org/10.31539/intecoms.v7i5.11823

Rahmatullah, A., & Annisa, Q. (2026). Application Of TF-IDF And Word2vec For Feature Extraction In Sentiment Analysis Of Free Nutritious Food Policies. Journal of Computer Electronic and Telecommunication, 6(2). https://doi.org/10.52435/complete.v6i2.741

Ripaldi, R., Tambunan, L. S., Edowardo, S., Rahkmah, S. N., & Sutoyo, I. (2025). Penerapan Algoritma Machine Learning Random Forest untuk Prediksi Risiko Konversi Sindrom Terisolasi Klinis Menjadi Multiple Sclerosis. 5(1), 23–32. https://doi.org/10.47065/jogtc.v5i1.8847

Rizkiyanto, M. D., Purbolaksono, M. D., & Astuti, W. (2024). Sentiment Analysis Classification on PLN Mobile Application Reviews using Random Forest Method and TF-IDF Feature Extraction. INTEK: Jurnal Penelitian, 11(1), 37–43. https://doi.org/10.31963/intek.v11i1.4774

Yuliansyah, H., Ardiansyah, R., & Yudhana, A. (2026). View of A Machine Learning Approach for Multi-Label Classification in Candidate Election Social Media Analysis.pdf.

Yuliansyah, H., Raihan, H. A., & Murinto. (2025). Sentiment Analysis Model for VTuber Live Stream Chat using Decision Tree and Support Vector Machine. Journal of Innovation Information Technology and Application (JINITA), 7(2), 258–268. https://doi.org/10.35970/jinita.v7i2.2872

Yuliansyah,H. S. &. (2024a). Sistemasi: Jurnal Sistem Informasi Analisis Sentimen Berbasis Aspek Terhadap Ulasan Pengguna pada Game Honkai: Star Rail Menggunakan Naïve Bayes Classifier Aspect-Based Sentiment Analysis of User Reviews on the Game Honkai: Star Rail Using Naïve Bayes Cla. 13(5), 2540–9719. http://sistemasi.ftik.unisi.ac.id

Yuliansyah, H. S. &. (2024). Analisis Sentimen Berbasis Aspek Terhadap Ulasan Pengguna pada Game Honkai: Star Rail Menggunakan Naïve Bayes Classifier Aspect-Based Sentiment Analysis of User Reviews on the Game Honkai: Star Rail Using Naïve Bayes Cla. 13(5), 2540–9719.

Refbacks

  • There are currently no refbacks.