Sentiment Analysis of Presidential Candidates in 2024: A Comparison of the Performance of Support Vector Machine and Random Forest with N-Gram Method - Muhammad Rizki Ramadhan; Kholiq Budiman (Recursive Journal of Informatics, 2025)
Abstract. This paper conducts a sentiment analysis of presidential candidates in Indonesia's 2024 election using Twitter data. Utilizing the "Indonesia Presidential Candidate’s Dataset, 2024" from Kaggle, containing 8555 Twitter entries, sentiment was categorized as positive or negative. Preprocessing techniques cleaned and normalized the data, followed by labeling with the VADER lexicon. This study contributes insights into public sentiment towards presidential candidates and the effectiveness of machine learning algorithms for political sentiment analysis. Purpose: This study aims to analyze public sentiment towards presidential candidates in Indonesia's 2024 election using the N-Gram method. By employing Support Vector Machine and Random Forest algorithms, we compare their performance in sentiment analysis. Utilizing the "Indonesia Presidential Candidate’s Dataset, 2024" from Kaggle, containing 8555 Twitter data entries, we seek to provide insights into the electorate's perceptions and preferences, contributing to a deeper understanding of the political landscape during this crucial period. Methods/Study design/approach: The study uses Support Vector Machine (SVM) and Random Forest algorithms for sentiment analysis on a dataset of 8555 tweets about Indonesia’s 2024 presidential candidates. SVM, paired with TF-IDF, and Random Forest, paired with N-Gram, are used for feature extraction. The data is labeled using the Vader lexicon. Result/Findings: The study compared Support Vector Machine (SVM) with TF-IDF and Random Forest with N-Gram methods in analyzing public sentiment towards Indonesia's 2024 presidential candidates. Results showed Random Forest with N-Gram achieved 85% accuracy, outperforming SVM with TF-IDF at 82%. Novelty/Originality/Value: This study provides insights into sentiment analysis applied to the 2024 Indonesian presidential election, enhancing understanding of public sentiment dynamics. Comparing SVM with TF-IDF and Random Forest with N-Gram contributes to the field, suggesting avenues for future research such as integrating contextual information or social network analysis for deeper insights into political opinion trends.