Public Sentiment Analysis on the Service Quality of PT PLN on X Using Naïve Bayes and K-Nearest Neighbor Algorithms.
Keywords:
Sentiment Analysis, Naïve Bayes, K-Nearest Neighbor, PLN Service QualityAbstract
Quality services since electricity is a primary public need. However, numerous complaints still highlight PLN’s lack of responsiveness, especially on the X platform (formerly Twitter). This study aims to analyze public sentiment toward PLN’s service quality expressed on X and compare the performance of the Naïve Bayes and K-Nearest Neighbor (KNN) algorithms in classifying sentiments into positive, negative, and neutral categories. The research employs the Knowledge Discovery in Databases (KDD) approach, involving data collection through tweet scraping using Tweet-Harvest, preprocessing (case folding, tokenizing, filtering, stemming), transformation with TF-IDF weighting, and data mining using Naïve Bayes and KNN. Evaluation through a confusion matrix shows that Naïve Bayes achieved an accuracy of 87%, outperforming KNN with an accuracy of 86%. These findings provide insights for PLN to better understand public perception and serve as a reference for future sentiment analysis research using machine learning.
References
M. S. Alrajak, I. Ernawati, and I. Nurlaili, “Analisis sentimen terhadap Pelayanan PT PLN di Jakarta pada Twitter dengan Algoritma K- Nearest Neighbor (K-NN),” Semin. Nas. Mhs. Ilmu Komput. dan Apl., vol. 1, no. 2, pp. 110–122, 2020.
F. Herlando, A. R. Dzikrillah, F. Nufairi, E. Sinduningrum, and M. Sholeh, “Analisis Perbandingan Sentiment Dan Perbincangan Netizen Terhadap Twitter Pasca Pergantian Nama,” JIPI (Jurnal Ilm. Penelit. dan Pembelajaran Inform., vol. 9, no. 1, pp. 360–367, 2024, doi: 10.29100/jipi.v9i1.4934.
A. Fitri, N. Azizah, and V. P. Ramadhan, “Komparasi Naïve Bayes dan K-NN Dalam Analisis Sentimen di Twitter Terhadap Kemenangan Paslon 02,” no. 204, pp. 228–237, 2024.
S. Syafrizal, M. Afdal, and R. Novita, “Analisis Sentimen Ulasan Aplikasi PLN Mobile Menggunakan Algoritma Naïve Bayes Classifier dan K-Nearest Neighbor,” MALCOM Indones. J. Mach. Learn. Comput. Sci., vol. 4, no. 1, pp. 10–19, 2023, doi: 10.57152/malcom.v4i1.983.
M. Syarifuddinn, “Analisis Sentimen Opini Publik Mengenai Covid-19 Pada Twitter Menggunakan Metode Naïve Bayes Dan Knn,” INTI Nusa Mandiri, vol. 15, no. 1, pp. 23–28, 2020, doi: 10.33480/inti.v15i1.1347.
D. Jollyta, W. Ramdhan, and M. Zarlis, KONSEP DATA MINING DAN PENERAPAN. 2020.
A. Zanuardi and H. Suprayitno, “Analisa Karakteristik Kecelakaan Lalu Lintas di Jalan Ahmad Yani Surabaya melalui Pendekatan Knowledge Discovery in Database,” J. Manejemen Aset Infrastruktur Fasilitas, vol. 2, no. 1, pp. 45–55, 2018, doi: 10.12962/j26151847.v2i1.3767.
WowonPriatna, EkaNurA’ini, JoniWarta, AgusHidayat, TyastutiSriLestari, and Rasim, “Sentiment Analysis of Bjorka Hacker Using the Naive Bayes and C.45 Algorithms,” 2023.
Gading Viewieanti Eka Nur Fazriah, “Analisis Sentimen Pengguna Twitter Terhadap Pemakai Gadget Pada Anak Usia Dini Menggunakan Metode Support Vector Machine (SVM) dan Naive Bayes,” 2024.
Trias Handayanto and H. Herlawati, DATA MINING DAN MACHINE LEARNING MENGGUNAKAN MATLAB DAN PYTHON. 2020.
M. K. Amril Mutoi Siregar, S.Kom. and M. K. Adam Puspabhuana, S.Kom., DATA MINING. CV Kekata Group, 2017.
Endrik, A. Nugroho, and A. T. Zy, “Penerapan Algoritma Naive Bayes dan PSO pada Analisis Sentimen Kandidat Calon Presiden 2024,” Remik Ris. dan E-Jurnal Manaj. Inform. Komput., vol. 7, no. 3, pp. 1367–1380, 2023.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Nurul Zahra, Wowon Priatna, Tyastuti Sri Lestari

This work is licensed under a Creative Commons Attribution 4.0 International License.
Attribution 4.0 International
You are free to:
- Share — copy and redistribute the material in any medium or format for any purpose, even commercially.
- Adapt — remix, transform, and build upon the material for any purpose, even commercially.
- The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
- Attribution — You must give appropriate credit , provide a link to the license, and indicate if changes were made . You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation .
No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.


