Analisis Sentimen Opini Masyarakat Terhadap Pemilu 2024 Melalui Media Sosial X Dengan Menggunakan Naive Bayes, K-Nearest Neighbor Dan Decision Tree

Authors

  • Cut Shifa Khoirunnisa Teknik Informatika, Universitas Pamulang, Kota Tangerang Selatan, Banten
  • Tukiyat Universitas Pamulang, Kota Tangerang Selatan, Banten
  • Sajarwo Anggai Universitas Pamulang, Kota Tangerang Selatan, Banten

Keywords:

sentiment analysis, naïve bayes, Decision Tree, KNN

Abstract

This study aims to analyze public opinion sentiment towards the 2024 election using three machine learning classification algorithms: Naïve Bayes, K-Nearest Neighbors and Decision Tree. The data used in this study were taken from Social Media X, which is one of the social media platforms with a large and diverse data volume. The object of this study is public opinion expressed on Social Media X, with the subject of research in the form of tweets taken using the Twitter API, resulting in 5000 data with 2469 clean data. Data analysis involves text extraction and preprocessing processes that include data cleaning, tokenization, stopwords and stemming. The results of the study show the distribution of sentiment as follows: positive sentiment dominates with 96% of the total tweets, followed by neutral sentiment at 2% and negative sentiment at 1%. From the modeling results among the algorithms tested, K-Nearest Neighbors showed the best performance with an accuracy value reaching 97.50%, followed by Decision Tree having a performance with an accuracy value of 97.25% while Naïve Bayes had the lowest performance with an accuracy value of 96.14%. Although there is variation in performance among the algorithms used, none of them are completely consistent in classifying sentiment. This study makes a significant contribution in mapping public sentiment related to the 2024 election in Indonesia through data analysis from social media X, and provides insight into the effectiveness of various Data Mining Algorithms in sentiment analysis.

References

[1] S. Puad, G. Garno, and A. Susilo Yuda Irawan, “Analisis Sentimen Masyarakat Pada Twitter Terhadap Pemilihan Umum 2024 Menggunakan Algoritma Naïve Bayes,” JATI (Jurnal Mhs. Tek. Inform., vol. 7, no. 3, pp. 1560–1566, 2023, doi: 10.36040/jati.v7i3.6920.

[2] R. T. Aldisa and P. Maulana, “Analisis Sentimen Opini Masyarakat Terhadap Vaksinasi Booster COVID-19 Dengan Perbandingan Metode Naive Bayes, Decision Tree dan SVM,” Build. Informatics, Technol. Sci., vol. 4, no. 1, pp. 106–109, Jun. 2022, doi: 10.47065/bits.v4i1.1581.

[3] D. Normawati and S. A. Prayogi, “Implementasi Naïve Bayes Classifier Dan Confusion Matrix Pada Analisis Sentimen Berbasis Teks Pada Twitter,” J. Sains Komput. Inform. (J-SAKTI, vol. 5, no. 2, pp. 697–711, 2021.

[4] I. Saputra, T. Djatna, R. R. A. Siregar, D. A. Kristiyanti, H. R. Yani, and A. A. Riyadi, “Text Mining of PeduliLindungi Application Reviews on Google Play Store,” Fakt. Exacta, vol. 15, no. 2, pp. 101–108, 2022, doi: 10.30998/faktorexacta.v15i2.10629.

Downloads

Published

2025-01-08