Kasya Rizkia Putri, Denis Eka Cahyani
Twitter has developed into a significant community forum and an effective campaign tool, making it a valuable source for understanding public sentiment. This study addresses the problem of analyzing public opinion regarding the 2024 Indonesian presidential candidates through sentiment analysis, a crucial component of Natural Language Processing (NLP). The research aims to compare the performance of two machine learning, Naïve Bayes and Support Vector Machine (SVM), in classifying sentiment from Twitter data. To overcome the challenge of imbalanced data distribution, an oversampling technique was applied. The novelty of this study lies in its focus on the Indonesian political context and the application of random oversampling to solve data imbalance and enhance model performance. The results demonstrate that the SVM algorithm outperforms Naïve Bayes, achieving an accuracy of 0.8024, precision of 0.7814, recall of 0.8012, and f1-score of 0.7874. These findings highlight the effectiveness of SVM in sentiment analysis for political campaigns and provide valuable insights for future research in NLP and political communication. © 2025 American Institute of Physics Inc.. All rights reserved.
Department of Mathematics, Faculty of Mathematics and Natural Sciences, Universitas Negeri Malang, Malang, Indonesia