Sentiment Analysis of Instagram Comments on Capital Relocation Using SVM and Random Forest

Authors

  • Zery Mesanda Universitas Islam Negeri Sumatera Utara
  • Boy Arnol Sitompul Universitas Prima Indonesia

DOI:

https://doi.org/10.65371/metrokom.v2i1.59

Keywords:

Sentiment Analysis, National Capital (IKN), Social Media, Support Vector Machine, Random Forest

Abstract

Social media sentiment analysis has become an important approach in understanding public opinion on strategic issues, including the discourse on the relocation of the national capital. This study aims to compare the performance of Support Vector Machine (SVM) and Random Forest (RF) algorithms in classifying the sentiment of public comments on Instagram. A total of 794 comment data were collected using web scraping techniques with Selenium and BeautifulSoup, then divided into 80% training data and 20% test data. The classification process was conducted after the text preprocessing stage, which included case folding, tokenizing, filtering, and stemming. The experimental results show that SVM achieved an accuracy of 75.0% with precision 0.7200, recall 0.7800, and F1-score 0.7488. Meanwhile, Random Forest performed better with an accuracy of 79.4%, precision of 0.7795, recall of 0.8200, and F1-score of 0.7992. Evaluation based on sentiment class shows that SVM can only achieve a correct rate of 75.0% in the positive class and 75.1% in the negative class, while Random Forest excels with 79.4% in the positive class and 79.3% in the negative class. These findings confirm that Random Forest is more optimal and consistent than SVM in sentiment analysis based on social media comments. This study recommends the use of ensemble learning algorithms such as Random Forest in similar studies, as well as further development with larger datasets and deep learning approaches to improve model accuracy and generalization.

References

Akter, M. T., Begum, M., & Mustafa, R. (2021). Bengali Sentiment Analysis of E-commerce Product Reviews using K-Nearest Neighbors. 2021 International Conference on Information and Communication Technology for Sustainable Development (ICICT4SD), 40–44. https://doi.org/10.1109/ICICT4SD50815.2021.9396910

Al Assyam, H. D., & Hasan, F. N. (2023). Analisis sentimen Twitter terhadap perpindahan ibu kota negara ke IKN nusantara menggunakan orange data mining. KLIK: Kajian Ilmiah Informatika Dan Komputer, 4(1), 341–349. https://doi.org/https://doi.org/10.30865/klik.v4i1.957

Aljuaid, H., Iftikhar, R., Ahmad, S., Asif, M., & Tanvir Afzal, M. (2021). Important citation identification using sentiment analysis of in-text citations. Telematics and Informatics, 56, 101492. https://doi.org/https://doi.org/10.1016/j.tele.2020.101492

Bari Antor, M., Jamil, A. H. M. S., Mamtaz, M., Monirujjaman Khan, M., Aljahdali, S., Kaur, M., Singh, P., & Masud, M. (2021). A comparative analysis of machine learning algorithms to predict Alzheimer’s disease. Journal of Healthcare Engineering, 2021(1), 9917919.

Becker, T., Rousseau, A.-J., Geubbelmans, M., Burzykowski, T., & Valkenborg, D. (2023). Decision trees and random forests. American Journal of Orthodontics and Dentofacial Orthopedics, 164(6), 894–897. https://doi.org/10.1016/j.ajodo.2023.09.011

Gibran, M. K., Rifki, M. I., Hasugian, A. H., Siahaan, A. T. A. A., Sahputra, A., & Ong, R. (2024). Sentiment Analysis of Platform X Users on Starlink Using Naive Bayes. Instal: Jurnal Komputer, 16(03), 210–220. https://doi.org/10.54209/jurnalinstall.v16i03.240

Ilhami, A. M., Hadiansyah, M. N. H., Baihaqi, A. A., & Khalid, I. P. (2024). Priority Decision Making System for Educational Fund Assistance Letters Using Top-Down Parsing Method. Jurnal Media Teknik Elektro Dan Komputer, 01(01), 19–26.

Irawan, D., Perkasa, E. B., Yurindra, Y., Wahyuningsih, D., & Helmud, E. (2021). Perbandingan Klassifikasi SMS Berbasis Support Vector Machine, Naive Bayes Classifier, Random Forest dan Bagging Classifier. Jurnal Sisfokom (Sistem Informasi Dan Komputer), 10(3), 432–437. https://doi.org/10.32736/sisfokom.v10i3.1302

Rambe, M. R. A., Zufria, I., & Rifki, M. I. (2025). Analisis Sentimen Masyarakat pada Platform Media Sosial X (Twitter) terhadap Pelantikan Kabinet Merah Putih Menggunakan Bernoulli Naïve Bayes. DEVICE: JOURNAL OF INFORMATION SYSTEM, COMPUTER SCIENCE AND INFORMATION TECHNOLOGY, 6(1), 83–102. https://doi.org/10.46576/device.v6i1.6360

Rifki, M. I., Gibran, M. K., Hasugian, A. H., & Solihin, M. D. (2025). PEMODELAN DAN EVALUASI PREDIKSI RSRP MENGGUNAKAN ARTIFICIAL NEURAL NETWORK UNTUK OPTIMASI KUALITAS LAYANAN JARINGAN KOMUNIKASI NIRKABEL. INFORMATIKA, 17(1), 392–401. https://doi.org/10.36723/juri.v17i1.751

Saputri, G. A., & Alita, D. (2024). Analisis Sentimen Twitter Terhadap Pemindahan Ibu Kota Negara Menggunakan Support Vector Machine. Jurnal Informatika: Jurnal Pengembangan IT, 9(3), 213–223.

Septhya, D., Rahayu, K., Rabbani, S., Fitria, V., Rahmaddeni, R., Irawan, Y., & Hayami, R. (2023). Implementasi Algoritma Decision Tree dan Support Vector Machine untuk Klasifikasi Penyakit Kanker Paru: Implementation of Decision Tree Algorithm and Support Vector Machine for Lung Cancer Classification. MALCOM: Indonesian Journal of Machine Learning and Computer Science, 3(1), 15–19. https://doi.org/https://doi.org/10.57152/malcom.v3i1.591

Setiawan, A., & Suryono, R. R. (2024). Analisis Sentimen Ibu Kota Nusantara menggunakan Algoritma Support Vector Machine dan Naïve Bayes. Edumatic: Jurnal Pendidikan Informatika, 8(1), 183–192. https://doi.org/https://doi.org/10.29408/edumatic.v8i1.25667

Singh, J., & Tripathi, P. (2021). Sentiment analysis of Twitter data by making use of SVM, Random Forest and Decision Tree algorithm. 2021 10th IEEE International Conference on Communication Systems and Network Technologies (CSNT), 193–198. https://doi.org/10.1109/CSNT51715.2021.9509679

Siregar, A. M. (2023). Analisis Sentimen Pindah Ibu Kota Negara (IKN) Baru pada Twitter Menggunakan Algoritma Naive Bayes dan Support Vector Machine (SVM). Faktor Exacta, 16(3). https://doi.org/http://dx.doi.org/10.30998/faktorexacta.v16i3.16703

Supian, A., Revaldo, B. T., Marhadi, N., Efrizoni, L., & Rahmaddeni, R. (2024). Perbandingan Kinerja Naïve Bayes Dan Svm Pada Analisis Sentimen Twitter Ibukota Nusantara. Jurnal Ilmiah Informatika, 12(01), 15–21. https://doi.org/https://doi.org/10.33884/jif.v12i01.8721

Suwardika, G., & Suniantara, I. K. P. (2019). Analisis Random Forest Pada Klasifikasi CART Ketidaktepatan Waktu Kelulusan Mahasiswa Universitas Terbuka. BAREKENG: Jurnal Ilmu Matematika Dan Terapan, 13(3), 179–186. https://doi.org/10.30598/barekengvol13iss3pp177-184ar910

Tusar, M. T. H. K., & Islam, M. T. (2021). A Comparative Study of Sentiment Analysis Using NLP and Different Machine Learning Techniques on US Airline Twitter Data. 2021 International Conference on Electronics, Communications and Information Technology (ICECIT), 1–4. https://doi.org/10.1109/ICECIT54077.2021.9641336

Zahoor, K., Bawany, N. Z., & Hamid, S. (2020). Sentiment Analysis and Classification of Restaurant Reviews using Machine Learning. 2020 21st International Arab Conference on Information Technology (ACIT), 1–6. https://doi.org/10.1109/ACIT50332.2020.9300098

Downloads

Published

2025-06-30

How to Cite

Mesanda, Z., & Sitompul, B. A. (2025). Sentiment Analysis of Instagram Comments on Capital Relocation Using SVM and Random Forest. Jurnal Metrokom : Media Teknik Elektro Dan Komputer, 2(1), 66–79. https://doi.org/10.65371/metrokom.v2i1.59