Implementation of Naïve Bayes Classifier & Support Vector Machine Algorithm for Sentiment Classification using Twitter Data on Indonesian Presidential Candidates In 2024

Main Article Content

Gigih Forda Nama, Atiqah Hanifah Shalihah, Puput Budi Wintoro, Yessi Mulyani, Dikpride Despa

Abstract

Indonesia is a democratic country, this is shown by the presidential election that is held every five years. In 2024, Indonesia is set to hold another presidential election, which has become a hot discussed topic among the public, particularly regarding the potential candidates who will be running for office. Many people voice their thoughts and opinion regarding the presidential candidates vying for office by means of tweets on the popular social media platform, Twitter. This classification model is built using machine learning algorithms, namely Naïve Bayes Classifier and Support Vector Machine. This study focuses on two presidential candidates, Anies Baswedan and Ganjar Pranowo. The dataset contains 3000 tweets in each dataset with an imbalanced class distribution. The percentage distribution for the labels in the Anies Baswedan dataset is 46.60% positive, 16.10% neutral, and 37.30% negative. Meanwhile, the percentage distribution for the labels in the Ganjar Pranowo dataset is 58.83% positive, 16.77% neutral, and 24.40% negative. The results show that using classification report evaluation method, the naïve bayes classifier algorithm has a higher performance on the Ganjar Pranowo, achieving an accuracy of 92%. Meanwhile, for the Anies Baswedan dataset, achieving an accuracy of 87%. For the SVM algorithm, an accuracy of 88% was obtained for the Anies Baswedan dataset, and an accuracy of 82% was obtained for the Ganjar Pranowo dataset. Based on the results, it can be observed that the naïve bayes classifier algorithm outperforms the SVM algorithm in sentiment classification.

Article Details

Section
Articles