Analisis Sentimen Calon Gubernur Jawa Tengah 2024 Menggunakan Metode Naïve Bayes
DOI:
https://doi.org/10.37859/jf.v15i3.10184
Abstract
Social media platform X (formerly Twitter) has become a public space where people can freely express their opinions, including in the context of regional elections. These opinions can be processed into useful information for decision-makers, especially in political contexts. This study aims to analyze public sentiment toward the candidates for Governor of Central Java for the 2024–2029 period using the Naïve Bayes method.
The data was collected through a crawling process on X using Tweet-Harvest and relevant keywords. The raw data then underwent preprocessing, including cleaning, case folding, normalization, stopword removal, tokenization, and stemming. Sentiment labeling was performed automatically using the TextBlob library, which classified tweets into positive, negative, or neutral categories. Naïve Bayes was chosen for its effectiveness and efficiency in text classification tasks.
The results showed model accuracy of 90.28% for Andika Perkasa and 84.51% for Ahmad Luthfi, using a 90:10 training-to-testing data ratio. Out of 452 total tweets, Andika Perkasa received 350 positive sentiments, slightly more than Ahmad Luthfi, who received 336. These findings indicate that public perception toward both candidates is generally positive, with a slight edge for Andika Perkasa.
Downloads
References
A. Rizal, “Pemilukada Serentak 2024: Dinamika, Urgensi dan Tantangan,” Proc. 1st Conf. Soc. Polit. Cult. 2022, vol. 1, pp. 136–140, 2022.
D. Permatasari, K. A. Nasution, M. R. Khairi, and F. F. Tambunan, “Opini Publik dalam Sistem Demokrasi,” vol. 7482, pp. 41–46, 2025.
M. Zaskya, A. Boham, and L. J. H. Lotulung, “Twitter Sebagai Media Mengungkapkan Diri Pada Kalangan Milenial Twitter as a Media for Self-Disclosure Among Millennials,” pp. 1–8, 2020.
D. D. Ayani, H. S. Pratiwi, and H. Muhardi, “Implementasi Web Scraping untuk Pengambilan Data pada Situs Marketplace,” vol. 7, no. 4, pp. 257–262, 2019.
F. Liantoni and H. Nugroho, “Klasifikasi Daun Herbal Menggunakan Metode Naïve Bayes Classifier dan K- Nearest Neighbor,” vol. 5, no. 1, pp. 9–16, 2015.
Y. Sunardhi, “Propaganda di Media Sosial,” pp. 1–11, 2025, [Online]. Available: https://www.yosephsunardhi.com/2025/01/propaganda-di-media-sosial.html
S. A. F. Syifa Khairunnisa, Adiwijaya, “Pengaruh Text Preprocessing terhadap Analisis Sentimen Komentar Masyarakat pada Media Sosial Twitter ( Studi Kasus Pandemi,” vol. 5, no. April, pp. 406–414, 2021, doi: 10.30865/mib.v5i2.2835.
R. Vindua and A. U. Zailani, “Analisis Sentimen Pemilu Indonesia Tahun 2024 Dari Media Sosial Twitter Menggunakan Python,” JURIKOM (Jurnal Ris. Komputer), vol. 10, no. 2, p. 479, 2023, doi: 10.30865/jurikom.v10i2.5945.
T. Ridwansyah, “Implementasi Text Mining Terhadap Analisis Sentimen Masyarakat Dunia Di Twitter Terhadap Kota Medan Menggunakan K-Fold Cross Validation Dan Naïve Bayes Classifier,” KLIK Kaji. Ilm. Inform. dan Komput., vol. 2, no. 5, pp. 178–185, 2022, doi: 10.30865/klik.v2i5.362.
N. Saputra, T. B. Adji, and A. E. Permanasari, “Analisis Sentimen Data Presiden Jokowi Dengan Preprocessing Normalisasi Dan Stemming Menggunakan Metode Naive Bayes Dan Svm,” J. Din. Inform., vol. 5, no. November, pp. 1–13, 2015.
A. F. Hidayatullah, “PENGARUH STOPWORD TERHADAP PERFORMA KLASIFIKASI TWEET BERBAHASA INDONESIA,” vol. 1, no. 1, pp. 1–4, 2016.
S. Ramadhani, D. Azzahra, U. I. Negeri, and S. S. Kasim, “Comparison of K-Means and K-Medoids Algorithms in Text Mining based on Davies Bouldin Index Testing for Classification of Student ’s Thesis,” vol. x, no. x, pp. 24–33, 2022.
M. U. Albab, Y. K. P, and M. N. Fawaiq, “Optimization of the Stemming Technique on Text preprocessing President 3 Periods Topic,” vol. 20, no. 2, pp. 1–10, 2023.
M. Faruqziddan, E. H. S. Aulia, S. D. Azzahra, and P. B. Utomo, “Perbandingan Skenario Balancing Oversampling dan Undersampling dalam Klasifikasi Resiko Kambuh Kanker Tiroid menggunakan Algoritma SVM Linear,” JAMI J. Ahli Muda Indones., vol. 5, no. 2, pp. 172–182, 2024, doi: 10.46510/jami.v5i2.320.
M. A. Hasan, “Ensemble Language Models for Multilingual Sentiment Analysis,” pp. 1–9, 2024, [Online]. Available: http://arxiv.org/abs/2403.06060
A. Lavanya, W. Ali, D. J. Lloret, S. D. Vidya Sagar, and C. Bharadwaj, “A Real-time Visualization of Global Sentiment Analysis on Declaration of Pandemic,” International Journal of Computer Engineering in Research Trends, vol. 9, no. 6. pp. 104–113, 2022. doi: 10.22362/ijcert/2022/v9/i06/v9i0602.
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.
M. K. Khatami, “Analisis Sentimen Twitter Menggunakan Naive Bayes dan Support Vector Machine Terhadap KPU Pada Pemilihan Umum Presiden 2024,” 2024.
M. Galih Pradana, “Penggunaan Fitur Wordcloud Dan Document Term Matrix Dalam Text Mining,” J. Ilm. Infromatika, vol. 08, no. 01, pp. 38–43, 2020.
Downloads
Published
Issue
Section
License
Copyright (c) 2025 Martin Nuh Hanan, Hamid Muhammad Jumasa, Ike Yunia Pasa

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Copyright Notice
An author who publishes in the Jurnal FASILKOM (teknologi inFormASi dan ILmu KOMputer) agrees to the following terms:
- Author retains the copyright and grants the journal the right of first publication of the work simultaneously licensed under the Creative Commons Attribution-ShareAlike 4.0 License that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal
- Author is able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book) with the acknowledgement of its initial publication in this journal.
- Author is permitted and encouraged to post his/her work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of the published work (See The Effect of Open Access).
Read more about the Creative Commons Attribution-ShareAlike 4.0 Licence here: https://creativecommons.org/licenses/by-sa/4.0/.










_(1).png)



