Mining Public Sentiment and Trends in Social Media Discussions on Indonesian Presidential Candidates Using Support Vector Machines
DOI:
https://doi.org/10.63913/jds.v1i2.8Keywords:
Sentiment Analysis, Support Vector Machine, Indonesian Presidential Election, Social Media Mining, Political DiscourseAbstract
This study investigates public sentiment surrounding the 2024 Indonesian presidential candidates by analyzing Twitter data collected between October 2022 and April 2023. Using Support Vector Machines (SVM) for sentiment classification, the research aims to uncover patterns in early public opinion during the pre-election period. A dataset of 28,782 tweets mentioning three main candidates—Anies Baswedan, Ganjar Pranowo, and Prabowo Subianto—was collected, cleaned, and processed. Exploratory Data Analysis (EDA) revealed that positive sentiment dominated discussions for all candidates, with Ganjar Pranowo receiving the highest proportion of positive tweets. Geographic and user engagement metrics further contextualized the digital discourse, highlighting differences in audience demographics and regional engagement. The text data was transformed using Term Frequency-Inverse Document Frequency (TF-IDF) vectorization, capturing both unigrams and bigrams, and limited to 5,000 features for computational efficiency. The dataset was split into training and testing sets with a 75/25 ratio. A linear kernel SVM was trained with class weighting to address class imbalance, achieving an accuracy of 87.9% on the test set. Precision, recall, and F1-score metrics indicated strong model performance, particularly for the positive sentiment class. Feature importance analysis identified key terms influencing classification, aligning intuitively with sentiment polarity. These findings demonstrate the viability of using SVM and social media data to analyze early political sentiment in emerging democratic contexts. The study contributes to the growing field of digital political analytics by providing insights into voter sentiment dynamics prior to official candidacy announcements. While limited to Twitter and a specific timeframe, the research lays groundwork for multi-platform, longitudinal studies. Future research could explore sentiment evolution throughout the election cycle and deeper analysis of sentiment drivers by region and policy.