Perbandingan Algoritma Naive Bayes, Random Forest, dan Support Vector Machine Terhadap Pandangan Masyarakat Mengenai Revisi Undang-Undang TNI di Instagram
Abstract
The revision of the Indonesian National Army Law (TNI Law), enacted in 2025, sparked widespread controversy within society, particularly concerning issues of civilian supremacy and potential military dominance. With the growing use of social media as a platform for public expression, platforms such as Instagram have become the primary medium for the public to voice their opinions regarding this issue. This study aims to analyze public sentiment toward the revision of the TNI Law by utilizing text classification algorithms, namely Naive Bayes, Random Forest, and Support Vector Machine (SVM). Data was collected from 28,669 Instagram comments and analyzed through stages of data crawling, preprocessing, and labeling. To address data imbalance, the Synthetic Minority Over-sampling Technique (SMOTE) was applied. Subsequently, classification was performed using the three algorithms, with evaluation metrics including accuracy, precision, recall, and F1-score. The results after SMOTE demonstrated that the SVM algorithm delivered the best performance with an accuracy of (92%), followed by Random Forest at (88%), and Naive Bayes at (76%). Consequently, SVM was deemed the most effective in capturing patterns of public sentiment objectively. This research is expected to contribute to the advancement of digital public opinion studies and support the evaluation process of national defense policies
Downloads
References
H. K. Muhid, “Fakta-fakta RUU TNI Disahkan Walau Tuai Penolakan,” TEMPO. Accessed: May 10, 2025. [Online]. Available: https://www.tempo.co/politik/fakta-fakta-ruu-tni-disahkan-walau-tuai-penolakan--1222777
A. T. DA, “DPR Akhirnya Setujui RUU TNI Jadi UU, Ini 3 Substansi yang Diatur!,” HukumOnline.Com. Accessed: May 10, 2025. [Online]. Available: https://www.hukumonline.com/berita/a/dpr-akhirnya-setujui-ruu-tni-jadi-uu--ini-3-substansi-yang-diatur-lt67dbbddd68c6f/
A. T. DA, “RUU TNI Berpeluang Tentara Masuk Sistem Penegakan Hukum,” Hukumonline.Com. Accessed: Aug. 11, 2025. [Online]. Available: https://www.hukumonline.com/berita/a/ruu-tni-berpeluang-tentara-masuk-sistem-penegakan-hukum-lt67db7ce6cb026/?page=3
S. Fatimah, “Transformasi Ruang Publik Digital : Tantangan Sosial dan Konstitusional dalam Demokrasi Era Media Baru,” Jurnal Litbang Kebijakan, vol. 19, no. 1, pp. 67–86, 2025, doi: 10.32781/cakrawala.v19i1.785
M. S. Alam, M. S. H. Mrida, and M. A. Rahman, “Sentiment Analysis in Social Media: How Data Science Impacts Public Opinion Knowledge Integrates Natural Language Processing (Nlp) With Artificial Intelligence (Ai),” American Journal of Scholarly Research and Innovation, vol. 4, no. 1, pp. 63–100, 2025, doi: 10.63125/r3sq6p80.
A. A. Nurhasananda and M. Akbar, “Analisis Sentimen Masyarakat Terhadap Kebijakan Undang-Undang Tentara Nasional Indonesia (UU TNI) Menggunakan Support Vector Machine,” Jurnal Komputer, Informasi dan Teknologi, vol. 5, no. 1, pp. 1–14, 2025.
A. Haris, K. Sandi, E. Haerani, L. Oktavia, and F. Kurnia, “Klasifikasi Sentimen Masyarakat Terhadap Revisi Undang-Undang Tentara Nasional Indonesia Menggunakan Naïve Bayes Classifier,” Bulletincsr, vol. 5, no. 4, pp. 594–603, 2025, doi: 10.47065/bulletincsr.v5i4.615.
H. Santoso, R. A. Putri, and S. Sahbandi, “Deteksi Komentar Cyberbullying pada Media Sosial Instagram Menggunakan Algoritma Random Forest,” Jurnal Manajemen Informatika (JAMIKA), vol. 13, no. 1, pp. 62–72, 2023, doi: 10.34010/jamika.v13i1.9303.
M. I. Ghozali, W. H. Sugiharto, and A. F. Iskandar, “Analisis Sentimen Pinjaman Online Di Media Sosial Twitter Menggunakan Metode Naive Bayes,” KLIK: Kajian Ilmiah Informatika dan Komputer, vol. 3, no. 6, pp. 1340–1348, 2023, doi: 10.30865/klik.v3i6.936.
I. H. Kusuma and N. Cahyono, “Analisis Sentimen Masyarakat Terhadap Penggunaan E-Commerce Menggunakan Algoritma K-Nearest Neighbor,” Jurnal Informatika: Jurnal Pengembangan IT, vol. 8, no. 3, pp. 302–307, 2023, doi: 10.30591/jpit.v8i3.5734.
A. Agung, A. Daniswara, I. Kadek, and D. Nuryana, “Data Preprocessing Pola Pada Penilaian Mahasiswa Program Profesi Guru,” Journal of Informatics and Computer Science, vol. 05, pp. 97–100, 2023.
A. Sentimen et al., “Analisis Sentimen Masyarakat Di Media Sosial X Terhadap Kemenkes Dengan Naive Bayes dan SVM,” Jurnal Sains dan Teknologi, vol. 7, no. 1, pp. 1–6, 2025.
F. N. Hidayat and S. Sugiyono, “Analisis Sentimen Masyarakat Terhadap Perekrutan Pppk Pada Twitter Dengan Metode Naive Bayes Dan Support Vector Machine,” Jurnal Sains dan Teknologi, vol. 5, no. 2, pp. 665–672, 2023, doi: 10.55338/saintek.v5i2.1359.
L. Hermawati, V. Berland, A. Rahmadiah, E. Hutabarat, and D. D. Saputra, “Komparasi Metode Text Mining Terhadap Masalah Pengklasifikasian Narasi Informative & Non Informative Pada twitter @ PLN _ 123,” Jurnal Sistim Informasi dan Teknologi, vol. 5, no. 1, pp. 109–120, 2023, doi: 10.37034/jsisfotek.v4i2.191.
R. Rinandyaswara, Y. A. Sari, and M. T. Furqon, “Pembentukan Daftar Stopword Menggunakan Term Based Random Sampling Pada Analisis Sentimen Dengan Metode Naïve Bayes (Studi Kasus: Kuliah Daring Di Masa Pandemi),” Jurnal Teknologi Informasi dan Ilmu Komputer, vol. 9, no. 4, p. 717, 2022, doi: 10.25126/jtiik.2022934707.
T. Ridwansyah, “Implementasi Text Mining Terhadap Analisis Sentimen Masyarakat Dunia Di Twitter Terhadap Kota Medan Menggunakan K-Fold Cross Validation Dan Naïve Bayes Classifier,” KLIK: Kajian Ilmiah Informatika dan Komputer, vol. 2, no. 5, pp. 178–185, 2022, doi: 10.30865/klik.v2i5.362.
S. F. N. Hadju and R. Jayadi, “Sentiment analysis of Indonesian e-commerce product reviews using support vector machine based term frequency inverse document frequency,” J Theor Appl Inf Technol, vol. 99, no. 17, pp. 4316–4325, 2021.
O. I. Gifari, Muh. Adha, F. Freddy, and F. F. S. Durrand, “Analisis Sentimen Review Film Menggunakan TF-IDF dan Support Vector Machine,” Journal of Information Technology, vol. 2, no. 1, pp. 36–40, 2022, doi: 10.46229/jifotech.v2i1.330.
A. Yulianti, Fadhilah Fitri, Nonong Amalita, and Dodi Vionanda, “The SMOTE Application of CART Methods for Coping Imbalanced Data in Classifying Status Work on Labor Force in the City of Padang,” UNP Journal of Statistics and Data Science, vol. 1, no. 3, pp. 172–179, 2023, doi: 10.24036/ujsds/vol1-iss3/12.
H. Eldo, A. Ayuliana, D. Suryadi, G. Chrisnawati, and L. Judijanto, “Penggunaan Algoritma Support Vector Machine (SVM) Untuk Deteksi Penipuan pada Transaksi Online,” Jurnal Minfo Polgan, vol. 13, no. 2, pp. 1627–1632, 2024, doi: 10.33395/jmp.v13i2.14186.
E. P. Febtiawan, L. A. S. I. Akbar, and A. S. Rachman, “Forecasting Produksi Energi Photovoltaic Menggunakan Algoritma Random Forest Classification,” Journal of Information System Research (JOSH), vol. 5, no. 4, pp. 1053–1062, 2024, doi: 10.47065/josh.v5i4.5514.
F. Septianingrum and A. S. Y. Irawan, “Metode Seleksi Fitur Untuk Klasifikasi Sentimen Menggunakan Algoritma Naive Bayes: Sebuah Literature Review,” Jurnal Media Informatika Budidarma, vol. 5, no. 3, p. 799, 2021, doi: 10.30865/mib.v5i3.2983.
Bila bermanfaat silahkan share artikel ini
Berikan Komentar Anda terhadap artikel Perbandingan Algoritma Naive Bayes, Random Forest, dan Support Vector Machine Terhadap Pandangan Masyarakat Mengenai Revisi Undang-Undang TNI di Instagram
Pages: 1433-1442
Copyright (c) 2025 Royhan Nasrul, Aditia Yudhistira

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





















