Analisis Sentimen Kinerja Lembaga Legislatif di Indonesia Menggunakan Algoritma Random Forest Berbasis Data Media Sosial X
Abstract
Legislative institutions such as the DPR RI are often the center of public attention and criticism on social media, particularly the X platform (formerly Twitter). The high volume of public opinion necessitates an automated classification system to monitor public perception efficiently. This study aims to analyze public sentiment towards the DPR RI in January 2025 using the Random Forest algorithm. A total of 699 tweets were collected via crawling techniques and processed through preprocessing stages including cleansing, folding, normalization, filtering, and stemming. Text features were extracted using the Term Frequency-Inverse Document Frequency (TF-IDF) method. Distribution results show a dominance of the neutral class (73.5%), followed by negative (22.2%) and positive (4.3%) sentiments. Model testing using a confusion matrix demonstrates that the Random Forest algorithm achieves high performance with an accuracy rate of 96.43%. Feature importance analysis reveals that profanity and integrity issues such as "corruption" are the primary indicators of negative sentiment. This study concludes that Random Forest is highly reliable in classifying public opinions with strong emotional polarity on social media.
Downloads
References
Adhitya, W. R., Teviana, T., Sienny, S., Hidayat, A., & Khaira, I. (2024). Implementasi Digital Marketing Menggunakan Platform E-Commerce dan Media Sosial Terhadap Masyarakat Dalam Melakukan Pembelian. TIN: Terapan Informatika Nusantara, 5(1), 63–72. https://doi.org/10.47065/tin.v5i1.5293
Aisy, A. R., Rahmaddeni, R., Siregar, A. H., Daulay, S., & Ananta, N. (2025). Implementasi Algoritma Support Vector Machine Dalam Mengklasifikasikan Berita Hoax Di Indonesia Pada Media Sosial X. Jurnal RESTIKOM : Riset Teknik Informatika Dan Komputer, 7(2), 206–216. https://doi.org/10.52005/restikom.v7i2.457
Almuayqil, S. N., Humayun, M., Jhanjhi, N. Z., Almufareh, M. F., & Javed, D. (2022). Framework for Improved Sentiment Analysis via Random Minority Oversampling for User Tweet Review Classification. Electronics (Switzerland), 11(19), 1–17. https://doi.org/10.3390/electronics11193058
Alshamari, M. A. (2023). Evaluating User Satisfaction Using Deep-Learning-Based Sentiment Analysis for Social Media Data in Saudi Arabia’s Telecommunication Sector. Computers, 12(9). https://doi.org/10.3390/computers12090170
Bengnga, A., & Ishak, R. (2023). Penerapan XGBoost untuk Seleksi Atribut pada K-Means dalam Clustering Penerima KIP Kuliah. Jambura Journal of Electrical and Electronics Engineering, 5(2), 192–196. https://doi.org/10.37905/jjeee.v5i2.20253
hidayat rahmatul. (2025). Strategi Kampanye Kandidat Dalam Pemilihan Presiden Indonesia 2024: Analisis Penggunaan Media Tradisional Dan Media Sosial. Core : Journal of Communication Research, 3(1), 12–25. https://journal.unpacti.ac.id/index.php/CORE/article/download/2024/1087
Hou, Y., & Huang, J. (2025). Natural language processing for social science research: A comprehensive review. Chinese Journal of Sociology, 11(1), 121–157. https://doi.org/10.1177/2057150X241306780
Imani, M., Beikmohammadi, A., & Arabnia, H. R. (2025). Comprehensive Analysis of Random Forest and XGBoost Performance with SMOTE, ADASYN, and GNUS Under Varying Imbalance Levels. Technologies, 13(3), 1–40. https://doi.org/10.3390/technologies13030088
Krishnamoorthy, P., Sathiyanarayanan, M., & Proença, H. P. (2024). A novel and secured email classification and emotion detection using hybrid deep neural network. International Journal of Cognitive Computing in Engineering, 5(December 2023), 44–57. https://doi.org/10.1016/j.ijcce.2024.01.002
Liu, J., Sun, Y., Zhang, Y., & Lu, C. (2024). Research on Online Review Information Classification Based on Multimodal Deep Learning. Applied Sciences (Switzerland), 14(9). https://doi.org/10.3390/app14093801
Machová, K., Mikula, M., Gao, X., & Mach, M. (2020). Lexicon-based sentiment analysis using particle swarm optimization. Electronics (Switzerland), 9(8), 1–22. https://doi.org/10.3390/electronics9081317
Madyatmadja, E. D., Sianipar, C. P. M., Wijaya, C., & Sembiring, D. J. M. (2023). Classifying Crowdsourced Citizen Complaints through Data Mining: Accuracy Testing of k-Nearest Neighbors, Random Forest, Support Vector Machine, and AdaBoost. Informatics, 10(4). https://doi.org/10.3390/informatics10040084
Manoppo, M. R., Kolang, I. C., Nur Fiat, D. N., Mawara, R. M. C., Sumarno, A. D. P., Yusupa, A., & Tarigan, V. (2025). Analisis Sentimen Publik Di Media Sosial Terhadap Kenaikan Ppn 12% Di Indonesia Menggunakan Indobert. Jurnal Kecerdasan Buatan Dan Teknologi Informasi, 4(2), 152–163. https://doi.org/10.69916/jkbti.v4i2.322
Matheus, R., Faber, R., Ismagilova, E., & Janssen, M. (2023). Digital transparency and the usefulness for open government. International Journal of Information Management, 73(December 2019), 102690. https://doi.org/10.1016/j.ijinfomgt.2023.102690
Najib, M., Maftuh, B., & Malihah, E. (2023). Peranan Penggunaan Media Sosial Untuk Meminimalisasi Konflik Isu Sara Di Indonesia. Jurnal Kolaborasi Resolusi Konflik, 5(2), 127–136. https://doi.org/10.24198/jkrk.v5i2.51017
Ramadhana, N., Purwanti, P., & Dahlan, D. (2024). Fenomena Sarkasme Penggunaan Nama Binatang Pada Politik Indonesia dalam Media Sosial X : Kajian Linguistik Forensik. Ilmu Budaya: Jurnal Bahasa, Sastra, Seni, Dan Budaya, 8(3), 390–402.
Rizqilla, M., Nurani, D., Supriatin, Rahmi, A. N., & Maemunah, M. (2025). Analisis Sentimen Kinerja Jokowi Menggunakan Motode Naïve Bayes. Remik : Riset Dan E-Jurnal Manajemen Informatika Komputer, 9(2), 550–561. https://doi.org//doi.org/10.33395/remik.v9i2.14670
Santoso, I. A. P. (2025). Peran Digitalisasi Dalam Meningkatkan Transparansi dan Akuntabilitas Pemerintahan. Indonesian Journal of Public Administration Review, 2(3), 1–10. https://doi.org/10.47134/par.v2i3.4004
Seneviratne, K., Nadeeshani, M., Senaratne, S., & Perera, S. (2024). Use of Social Media in Disaster Management: Challenges and Strategies. Sustainability (Switzerland) , 16(11). https://doi.org/10.3390/su16114824
Septiana, I., & Alita, D. (2024). Perbandingan Random Forest dan SVM dalam Analisis Sentimen Quick Count Pemilu 2024. Jurnal Informatika: Jurnal Pengembangan IT, 9(3), 224–233. https://doi.org/10.30591/jpit.v9i3.6640
Setiawan, R. P., Irawan, B., & Prihartono, W. P. (2025). Analisis Sentimen Ulasan Growtopia Di Google Play Store Menggunakan Naïve Bayes Classifier Untuk Identifikasi Kebutuhan Pengguna. Jurnal Informatika Dan Teknik Elektro Terapan, 13(2). https://doi.org/10.23960/jitet.v13i2.6415
Vieira Sobrinho, J. L., Teles Vieira, F. H., & Assis Cardoso, A. (2024). Two-Stage Dimensionality Reduction for Social Media Engagement Classification. Applied Sciences (Switzerland), 14(3). https://doi.org/10.3390/app14031269
Yang, L., Marmolejo Duarte, C., & Martí Ciriquián, P. (2022). Quantifying the relationship between public sentiment and urban environment in Barcelona. Cities, 130(December 2020), 1–18. https://doi.org/10.1016/j.cities.2022.103977
Yuli, S., Utami Yulihapsari, I., Sundari, P., Purwoko, H., & Firdiansyah Suryawan, R. (2024). Penerapan Manajemen Berbasis Data Untuk Pengambilan Keputusan Yang Lebih Efektif : Dalam Suatu Perspektif. Management Studies and Entrepreneurship Journal, 5(2), 5260–5268. http://journal.yrpipku.com/index.php/msej
Zaydi, M., & As’ari, H. (2025). Penerapan Prinsip E-Government dalam Implementasi Sistem Pemerintahan Berbasis Elektronik (SPBE) Pada Dinas Kependudukan dan Pencatatan Sipil di Kota Pekanbaru. Jurnal Pendidikan Tambusai, 9(3), 30055–30063. https://jptam.org/index.php/jptam/article/view/31855
Bila bermanfaat silahkan share artikel ini
Berikan Komentar Anda terhadap artikel Analisis Sentimen Kinerja Lembaga Legislatif di Indonesia Menggunakan Algoritma Random Forest Berbasis Data Media Sosial X
Pages: 613-624
Copyright (c) 2025 Imam Saputra, Robbi Rahim

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













