Comparison of Naïve Bayes and Random Forest in Sentiment Analysis of State-Owned Banks Management by Danantara on X and YouTubeComparison of Naïve Bayes and Random Forest in Sentiment Analysis of State-Owned Banks Management by Danantara on X and YouTube
DOI:
https://doi.org/10.56705/ijodas.v6i3.366Keywords:
Sentiment Analysis, Naïve Bayes, Random Forest, Danantara, Stated-owned BankAbstract
The advancement of digital technology has increased public engagement in expressing opinions and responding to issues on social media platforms such as X and YouTube. A prominent topic of recent public debate concerns Danantara's management of state-owned banks. This study analyzes public sentiment regarding this issue by comparing the performance of the Naïve Bayes and Random Forest classification methods. A dataset comprising 25,565 entries was collected from both platforms between January 2025 and May 2025. The data underwent text pre-processing, labeling with the InSet Lexicon, and feature weighting using term frequency-inverse document frequency (TF-IDF). The dataset was split at 80:20, and class imbalance was addressed using the Synthetic Minority Over-sampling Technique (SMOTE) prior to classification. Model performance was evaluated using accuracy, precision, recall, and F1-score metrics. The results demonstrate that Random Forest performed stably, achieving 84% accuracy both before and after sampling. In contrast, Naïve Bayes achieved 74% accuracy before sampling, which increased to 79% after sampling. These findings suggest that Random Forest is more robust to data imbalance than Naïve Bayes, which is more susceptible to bias toward the majority class.
Downloads
References
[1] R. H. Pandjaitan, “The Social Media Marketing Mix Trends in Indonesia for 2024: Communication Perspective,” Jurnal Komunikasi Ikatan Sarjana Komunikasi Indonesia, vol. 9, no. 1, hlm. 251–269, Jun 2024, doi: 10.25008/jkiski.v9i1.1005.
[2] V. Oldemburgo de Mello, F. Cheung, dan M. Inzlicht, “Twitter (X) use predicts substantial changes in well-being, polarization, sense of belonging, and outrage,” Communications Psychology, vol. 2, no. 1, Feb 2024, doi: 10.1038/s44271-024-00062-z.
[3] H. Indrajat, T. Maryanah, dan A. Marta, “Analysis of Public Opinion on Social Media X and YouTube on the Results of the 2024 Presidential Election,” Journal Terekam Jejak (JTJ), vol. 3, hlm. 2025, 2025, doi: https://doi.org/10.5281/.
[4] Y. Qin, A. Musetti, dan B. Omar, “Flow Experience Is a Key Factor in the Likelihood of Adolescents’ Problematic TikTok Use: The Moderating Role of Active Parental Mediation,” Int J Environ Res Public Health, vol. 20, no. 3, Feb 2023, doi: 10.3390/ijerph20032089.
[5] A. Reihan Thoriq, C. A. Larissa, I. Nur, dan S. Makmur, “The Relevance Of The Establishment Of Daya Anagata Nusantara To The Budget Efficiency Policy Of The Merah Putih Cabinet Administration,” Journal Social Sciences and Humanioran Review, vol. 1, no. 6, hlm. 265–276, 2024, doi: 10.64578/jsshr.v1i06.146.
[6] C. Diah Ayu, F. Febiani, F. Ardhani, M. Leonardo, N. Syahwa, dan A. Setiawan Nuraya, “Keterkaitan Danantara dengan Stabilitas Keuangan Makro di Indonesia: Sebuah Pendekatan Teori Ekonomi Makro,” Indonesian Research Journal on Education, vol. 5, hlm. 1026–1031, 2025.
[7] R. W. Harwenda, M. David Angelo, I. Budi, A. B. Santoso, dan K. Putra, “Sentiment Analysis on Government Public Policies: A Systematic Literature Review,” DIJEMSS, vol. 6, no. 5, 2025, doi: 10.38035/dijemss.v6i5.
[8] P. R. Raval, D. R. Jivrajani, A. Biswal, H. M. Vegad, K. Murugan, dan A. Durani, “NLP-Based Sentiment Analysis of Social Media Data on Public Perception of Environmental Policies,” Int J Environ Sci, vol. 11, no. 23, hlm. 2025, 2025, doi: 10.64252/1ygxfv29.
[9] F. Fauzi, W. Setiayani, T. W. Utami, E. Yuliyanto, dan I. W. Harmoko, “Comparison Of Random Forest And Naïve Bayes Classifier Methods In Sentiment Analysis On Climate Change Issue,” Barekeng, vol. 17, no. 3, hlm. 1439–1448, Sep 2023, doi: 10.30598/barekengvol17iss3pp1439-1448.
[10] L. Dube dan T. Vaster, “Enhancing classification performance in imbalanced datasets: A comparative analysis of machine learning models,” Data Science in Finance and Economics, vol. 3, no. 4, hlm. 354–379, Okt 2023, doi: 10.3934/DSFE.2023021.
[11] K. Lemons, “A Comparison Between Naïve Bayes and Random Forest to Predict Breast Cancer,” International Journal of Undergraduate Research and Creative Activities, vol. 12, no. 1, hlm. 1, Okt 2020, doi: 10.7710/2168-0620.0287.
[12] K. W. Trisna dan H. J. Jie, “Deep Learning Approach for Aspect-Based Sentiment Classification: A Comparative Review,” 2022, Taylor and Francis Ltd. doi: 10.1080/08839514.2021.2014186.
[13] P. Nandwani dan R. Verma, “A review on sentiment analysis and emotion detection from text,” 1 Desember 2021, Springer. doi: 10.1007/s13278-021-00776-6.
[14] M. A. Gumilang, F. Abdillah, M. Y. Amin, dan M. Hasan, “Sentiment Analysis of Indonesian Ministries Social Media: Citizen Responses Utilizing TextBlob Analyser,” Jurnal Sosioteknologi, vol. 23, no. 2, hlm. 203–216, Agu 2024, doi: 10.5614/sostek.itbj.2024.23.2.5.
[15] I. Hendriyadi, A. Febrianti Putri, N. Ningsih, P. Rizki Widianti, dan dedi Bi Saputra, “Sentiment Analysis of Rising Fuel Prices on Social Media Twitter using the Naïve Algorithm Bayes Classifiers And AdaBoost,” Informatics and Software Engineering, vol. 1, no. 1, hlm. 14–23, 2020, doi: 10.58777/ise.v1i1.55.
[16] Pristiyono, M. Ritonga, M. A. Al Ihsan, A. Anjar, dan F. H. Rambe, “Sentiment analysis of COVID-19 vaccine in Indonesia using Naïve Bayes Algorithm,” IOP Conf Ser Mater Sci Eng, vol. 1088, no. 1, hlm. 012045, Feb 2021, doi: 10.1088/1757-899x/1088/1/012045.
[17] V. Nakhipova dkk., “Use of the Naive Bayes Classifier Algorithm in Machine Learning for Student Performance Prediction,” International Journal of Information and Education Technology, vol. 14, no. 1, hlm. 92–98, 2024, doi: 10.18178/ijiet.2024.14.1.2028.
[18] R. Hariyanto, M. Z. Sarwani, dan Y. N. Aprilia, “Prediction of Stunting Nutritional Status in Toddlers Using Naïve Bayes Classifier Algorithm,” JIPI (Jurnal Ilmiah Penelitian dan Pembelajaran Informatika), vol. 10, no. 2, hlm. 1111–1117, Mar 2025, doi: 10.29100/jipi.v10i2.5930.
[19] M. M. Danyal, S. S. Khan, M. Khan, M. B. Ghaffar, B. Khan, dan M. Arshad, “Sentiment Analysis Based on Performance of Linear Support Vector Machine and Multinomial Naïve Bayes Using Movie Reviews with Baseline Techniques,” Journal on Big Data, vol. 5, hlm. 1–18, Sep 2023, doi: 10.32604/jbd.2023.041319.
[20] A. A. Ajhari, “The Comparison of Sentiment Analysis of Moon Knight Movie Reviews between Multinomial Naive Bayes and Support Vector Machine,” Applied Information System and Management (AISM), vol. 6, no. 1, hlm. 13–20, Apr 2023, doi: 10.15408/aism.v6i1.26045.
[21] M. Sheykhmousa, M. Mahdianpari, H. Ghanbari, F. Mohammadimanesh, P. Ghamisi, dan S. Homayouni, “Support Vector Machine Versus Random Forest for Remote Sensing Image Classification: A Meta-Analysis and Systematic Review,” 2020, Institute of Electrical and Electronics Engineers Inc. doi: 10.1109/JSTARS.2020.3026724.
[22] A. R. Alsaber, J. Pan, dan A. Al-Hurban, “Handling complex missing data using random forest approach for an air quality monitoring dataset: A case study of kuwait environmental data (2012 to 2018),” Int J Environ Res Public Health, vol. 18, no. 3, hlm. 1–26, Feb 2021, doi: 10.3390/ijerph18031333.
[23] M. R. F. Rahmatullah, P. N. Andono, Affandy, dan M. A. Soeleman, “Improving Random Forest Performance for Sentiment Analysis on Unbalanced Data Using SMOTE and BoW Integration: PLN Mobile Application Case Study,” Scientific Journal of Informatics, vol. 12, no. 1, hlm. 1–10, Apr 2025, doi: 10.15294/sji.v12i1.19295.
[24] M. A. Palomino dan F. Aider, “Evaluating the Effectiveness of Text Pre-Processing in Sentiment Analysis,” Applied Sciences (Switzerland), vol. 12, no. 17, Sep 2022, doi: 10.3390/app12178765.
[25] V. Fitriyana dkk., “Analisis Sentimen Ulasan Aplikasi Jamsostek Mobile Menggunakan Metode Support Vector Machine,” 2023.
[26] Y. Fauziah, B. Yuwono, dan A. S. Aribowo, “Lexicon Based Sentiment Analysis in Indonesia Languages : A Systematic Literature Review,” RSF Conference Series: Engineering and Technology, vol. 1, no. 1, hlm. 363–367, Des 2021, doi: 10.31098/cset.v1i1.397.
[27] H. Permana dkk., “Analisis Sentimen Terhadap Bakal Calon Presiden 2024 Dengan Algoritma Multinomial Naïve Bayes Dan Oversampling Smote,” Jurnal Mahasiswa Teknik Informatika, vol. 7, no. 5, 2023, doi: 10.36040/jati.v7i5.7309.
[28] R. Wijayanti dan A. Arisal, “Automatic Indonesian Sentiment Lexicon Curation with Sentiment Valence Tuning for Social Media Sentiment Analysis,” ACM Transactions on Asian and Low-Resource Language Information Processing, vol. 20, no. 1, hlm. 1–16, Jan 2021, doi: 10.1145/3425632.
[29] R. Firdaus, I. Asror, dan A. Herdiani, “Lexicon-Based Sentiment Analysis of Indonesian Language Student Feedback Evaluation,” Ind. Journal on Computing, vol. 6, no. 1, hlm. 1–12, Apr 2021, doi: 10.34818/indojc.2021.6.1.408.
[30] N. Juliana Sahera dan S. Barokah Nur Ilahi, “Utilization of TF-IDF Weighting in Song Search System Based on Spotify Lyrics,” Journal of Artificial Intelligence and Engineering Applications , vol. 4, no. 3, hlm. 2808–4519, Jun 2025, doi: 10.59934/jaiea.v4i3.998.
[31] D. Wulan Yekti Rahayu dkk., “Performance of Machine Learning Algorithms on Imbalanced Sentiment Datasets Without Balancing Techniques,” 2025. doi: 10.30871/jaic.v9i3.9584.
[32] D. Kurniasari, R. N. Hidayah, N. Notiragayu, W. Warsono, dan R. K. Nisa, “Classification Models For Academic Performance: A Comparative Study Of Naïve Bayes And Random Forest Algorithms In Analyzing University Of Lampung Student Grades,” Jurnal Teknik Informatika (Jutif), vol. 5, no. 5, hlm. 1267–1276, Okt 2024, doi: 10.52436/1.jutif.2024.5.5.2066.
[33] J. P. Arisula dan P. Parjito, “Comparison Of Naive Bayes And Random Forest Methods In Sentiment Analysis On The Getcontact Application,” Jurnal Teknik Informatika (Jutif), vol. 5, no. 5, hlm. 1221–1230, Okt 2024, doi: 10.52436/1.jutif.2024.5.5.2004.
Downloads
Published
Issue
Section
License
Copyright (c) 2025 Ni Wayan Indah Juliandewi, Aniek Suryanti Kusuma, Kompiang Martina Dinata Putri, I Gusti Agung Indrawan, I Gusti Ayu Agung Mas Aristamy

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
Authors retain copyright and full publishing rights to their articles. Upon acceptance, authors grant Indonesian Journal of Data and Science a non-exclusive license to publish the work and to identify itself as the original publisher.
Self-archiving. Authors may deposit the submitted version, accepted manuscript, and version of record in institutional or subject repositories, with citation to the published article and a link to the version of record on the journal website.
Commercial permissions. Uses intended for commercial advantage or monetary compensation are not permitted under CC BY-NC 4.0. For permissions, contact the editorial office at ijodas.journal@gmail.com.
Legacy notice. Some earlier PDFs may display “Copyright © [Journal Name]” or only a CC BY-NC logo without the full license text. To ensure clarity, the authors maintain copyright, and all articles are distributed under CC BY-NC 4.0. Where any discrepancy exists, this policy and the article landing-page license statement prevail.










