Sentiment Analysis of Political Debates on YouTube: Comparative Performance of Naive Bayes and Logistic Regression
DOI:
https://doi.org/10.35806/ijoced.v8i2.584Keywords:
Indonesian Election 2024, Logistic Regression, Naive Bayes, Natural Language Processing, Sentiment Analysis, Social Media Analytics, YouTube CommentsAbstract
The 2024 Indonesian Presidential Election aimed at electing the President and Vice President for the 2024-2029 term. Central to this election were candidate debates, critical moments for presenting their visions and enabling public evaluation. These debates, accessible on platforms such as YouTube, facilitate public commentary and form the basis for sentiment analysis. However, analyzing YouTube comments presents challenges due to the volume of data, language diversity, and varied expressions. Sentiment analysis, essential for gauging public opinion of political figures, uses algorithms such as Naive Bayes and Logistic Regression. While Naive Bayes assumes feature independence, facilitating rapid implementation in text analysis, Logistic Regression is a discriminative model that captures feature dependencies, allowing it to assign specific weights to words or phrases that strongly signal positive or negative political sentiment. Applied to YouTube comments on the 2024 Indonesian Presidential debates, Logistic Regression demonstrated superior performance with an average accuracy of 90.57% on the aggregated dataset of five debates, outperforming Naive Bayes, which achieved 85.24% using a standard 80:20 train-test split. These findings validate the use of Naive Bayes and Logistic Regression for sentiment analysis during significant political events, confirming the efficacy of integrating advanced transformer models for automated data labeling with classical classifiers for robust, real-time political sentiment analysis.
References
Angdresey, A., Kairupan, I. Y., & Emor, K. G. (2022). Classification and Sentiment Analysis on Tweets of the Ministry of Health Republic of Indonesia. The 7th International Conference on Informatics and Computing (ICIC), 1–6. doi: 10.1109/ICIC56845.2022.10007008
Angdresey, A., Sitanayah, L., & Tangka, I. L. H. (2025). Sentiment Analysis for Political Debates on YouTube Comments using BERT Labeling, Random Oversampling, and Multinomial Naive Bayes. Journal of Computing Theories and Applications (JCTA), 2(3), 342–354. doi: [https://doi.org/10.62411/jcta.11668](https://doi.org/10.62411/jcta.11668)
Devlin, J., Chang, M. W., Lee, K., & Toutanova,K. (2019). BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. The 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, 4171–4186. doi: 10.18653/v1/N19-1423
Huang, H., Zavareh, A. S., & Mustafa, M. B. (2023). Sentiment Analysis in E-Commerce Platforms: A Review of Current Techniques and Future Directions. IEEE Access, 11, 90367–90382. doi: 10.1109/ACCESS.2023.3307308
Kamalov, F., Leung, H. H., & Cherukuri, A. K. (2023). Keep It Simple: Random Oversampling for Imbalanced Data. Advances in Science and Engineering Technology International Conferences (ASET), 1–4. doi: 10.1109/ASET56582.2023.10180891
Kosasih, R., & Alberto, A. (2021). Sentiment Analysis of Game Product on Shopee Using the TF-IDF Method and Naive Bayes Classifier. ILKOM Jurnal Ilmiah, 13(2), 101–109. doi: [https://doi.org/10.33096/ilkom.v13i2.721.101-109](https://doi.org/10.33096/ilkom.v13i2.721.101-109)
Kowsari, K., Meimandi, K. J., Heidarysafa, M., Mendu, S., Barnes, L., & Brown, D. (2019). Text Classification Algorithms: A Survey. Information, 10(4), 150. doi: [https://doi.org/10.3390/info10040150](https://doi.org/10.3390/info10040150)
Kwon, H. J., Ban, H. J., Jun, J. K., & Kim, H. S. (2021). Topic Modeling and Sentiment Analysis of Online Reviews for Airlines. Information, 12(2), 78. doi: [https://doi.org/10.3390/info10040150](https://doi.org/10.3390/info10040150)
Lan, Z., Chen, M., Goodman, S., Gimpel, K., Sharma, P., & Soricut, R. (2020). ALBERT: A Lite BERT for Self-Supervised Learning of Language Representations. The 8th International Conference on Learning Representations (ICLR).
Lase, Y. Y., Lubis, A. R., Elyza, F., & Syafli, S. A. (2023). Mental Health Sentiment Analysis on Social Media TikTok with the Naive Bayes Algorithm. The 6th International Conference of Computer and Informatics Engineering (IC2IE), 186–191. doi: 10.1109/IC2IE60547.2023.10331126
Liu, Y., Ott, M., Goyal, N., Du, J., Joshi, M., Chen, D., Levy, O., Lewis, M., Zettlemoyer, L., & Stoyanov, V. (2019). RoBERTa: A Robustly Optimized BERT Pretraining Approach. ArXiv 1907.11692. doi: [https://doi.org/10.48550/arXiv.1907.11692](https://doi.org/10.48550/arXiv.1907.11692)
Machuca, C. R., Gallardo, C., & Toasa, R. M. (2021). Twitter Sentiment Analysis on Coronavirus: Machine Learning Approach. Journal of Physics: Conference Series, 1828(1). doi: 10.1088/1742-6596/1828/1/012104
Matrutty, J. P., Adrian, A. M., & Angdresey, A. (2023). Sentiment Analysis of Visitor Reviews on Star Hotels in Manado City. Journal of Information Technology and Computer Science, 8(1), 21–32. doi: [https://doi.org/10.25126/jitecs.202381403](https://doi.org/10.25126/jitecs.202381403)
Nishad, P., & Sankar, S. (2016). Efficient Random Sampling Statistical Method to Improve Big Data Compression Ratio and Pattern Matching Techniques for Compressed Data. International Journal of Computer Science and Information Security, 14(6), 179–184.
Pajila, O. J. B., Sheena, B. G., Gayathri, A., Aswini, J., Nalini, M., & Subramanian, R. S. (2023). A Comprehensive Survey on Naive Bayes Algorithm: Advantages, Limitations, and Applications. The 4th International Conference on Smart Electronics and Communication (ICOSEC), 1228–1234. doi: 10.1109/ICOSEC58147.2023.10276274
Purbaratri, W., Purnomo, H., Manongga, D., Setyawan, I., & Hendry, H. (2024). Sentiment Analysis of e-Government Service Using the Naive Bayes Algorithm. Jurnal Manajemen, Teknik Informatika dan Rekayasa Komputer (MATRIK), 23(2), 441–452. doi: [https://doi.org/10.30812/matrik.v23i2.3272](https://doi.org/10.30812/matrik.v23i2.3272)
Rogers, A., Kovaleva, O., & Rumshisky, A. (2020). A Primer in BERTology: What We Know About How BERT Works. Transactions of the Association for Computational Linguistics, 8, 842–866.
Ruan, T., & Lv, Q. (2023). Public Perception of Electric Vehicles on Reddit and Twitter: A Cross-Platform Analysis. Transportation Research Interdisciplinary Perspectives, 21. doi: [https://doi.org/10.1016/j.trip.2023.100872](https://doi.org/10.1016/j.trip.2023.100872)
Schumaker, R. P., & Chen, H. (2009). Textual Analysis of Stock Market Prediction Using Breaking Financial News: The AZFin Text System. ACM Transactions on Information Systems, 27(2), 1–19. doi: [https://doi.org/10.1145/1462198.1462204](https://doi.org/10.1145/1462198.1462204)
Setiadi, D. R. I. M., Marutho, D., & Setiyanto, N. A. (2024). Comprehensive Exploration of Machine and Deep Learning Classification Methods for Aspect-Based Sentiment Analysis with Latent Dirichlet Allocation Topic Modeling. Journal of Future Artificial Intelligence and Technologies (FAITH), 1(1), 12–22. doi: [https://orcid.org/0000-0001-6615-4457](https://orcid.org/0000-0001-6615-4457)
Sulistianingsih, N., & Switrayana, I. N. (2024). Enhancing Sentiment Analysis for the 2024 Indonesia Election Using SMOTE-Tomek Links and Binary Logistic Regression. International Journal of Education and Management Engineering (IJEME), 14(3), 22–32. doi: [https://doi.org/10.5815/ijeme.2024.03.03](https://doi.org/10.5815/ijeme.2024.03.03)
Sundarreson, P., & Kumarapathirage, S. (2024). SentiGEN: Synthetic Data Generator for Sentiment Analysis. Journal of Computing Theories and Applications (JCTA), 1(4), 461–477. doi: [https://doi.org/10.62411/jcta.10480](https://doi.org/10.62411/jcta.10480)
Wongkar, M., & Angdresey, A. (2019). Sentiment Analysis Using Naive Bayes Algorithm of the Data Crawler: Twitter. The 4th International Conference on Informatics and Computing (ICIC), 1–5. doi: 10.1109/ICIC47613.2019.8985884
Yusuf, K. K., Ogbuju, E., Abiodun, T., & Oladipo, F. (2024). A Technical Review of the State-of-the-Art Methods in Aspect-Based Sentiment Analysis. Journal of Computing Theories and Applications (JCTA), 1(3), 287–298. doi: [https://doi.org/10.62411/jcta.9999](https://doi.org/10.62411/jcta.9999)
Zhang, Z., Tang, Y., Zhang, P., Zhang, P., Zhang, D., & Wang, P. (2023). An Adaptive Drilling Sampling Method and Evaluation Model for Large-Scale Streaming Data. The 24th International Conference on Web Information Systems Engineering (WISE), 813–825. doi: 10.1007/978-981-99-7254-8_63

















