Kinetik: Game Technology, Information System, Computer Network, Computing, Electronics, and Control
Vol. 8, No. 2, May 2023

Public Opinion Analysis of Presidential Candidate Using Naïve Bayes Method

Asno Azzawagama Firdaus (Universitas Ahmad Dahlan)
Anton Yudhana (Universitas Ahmad Dahlan)
Imam Riadi (Universitas Ahmad Dahlan)



Article Info

Publish Date
30 May 2023

Abstract

Elections for president and vice president will take place in 2024. Heading into the election, promoted candidates were vying for public sympathy. People often discussed as presidential candidates are Anies Baswedan, Ganjar Pranowo, and Prabowo Subianto. Therefore, we need a way to predict potential candidates and voter demographics from public opinion on Twitter using sentiment analysis. One of his methods commonly used to classify sentiment analysis is Naive Bayes. This study used the naive Bayes classifier and the TF-IDF extraction function to add weights to the text. Use the scikit-learn Python library to help determine the polarity of negative and positive sentiment classes in your dataset. The datasets used were Twitter datasets acquired from October to December 2022, for a total of 15,000 datasets. The best test scenario obtained by splitting the test and training data is 70% test data and 30% training data, with the highest accuracy generated from the 95% Ganjar dataset. Using the Anies, Ganjar, and Prabowo test data, the positive mood scores for each candidate were 833, 77, and 524, respectively, while the negative mood scores were 637, 1423, and 976, respectively. The test was performed using a confusion matrix and k-fold cross-validation, and the best results were obtained on the Ganjar data set. That is a confusion matrix of 94.93% and a k-fold cross-validation of 94.46%. The lowest f1-score for the positive class is 67% for the Anies dataset and 27% for the negative class for the Ganjar dataset.

Copyrights © 2023






Journal Info

Abbrev

kinetik

Publisher

Subject

Computer Science & IT Control & Systems Engineering Electrical & Electronics Engineering Energy Engineering

Description

Kinetik: Game Technology, Information System, Computer Network, Computing, Electronics, and Control was published by Universitas Muhammadiyah Malang. journal is open access journal in the field of Informatics and Electrical Engineering. This journal is available for researchers who want to improve ...