A Comparative Study of Naïve Bayes and K-Nearest Neighbors (KNN) Algorithms in Sentiment Analysis of ChatGPT Usage Among Students - Syahli Kurniawan; Hidayat, Rahmad; Muhammad Reza Zulman (Politeknik Negeri Batam, 2025)
This study compares the performance of the Naïve Bayes and K-Nearest Neighbors (KNN) algorithms in sentiment analysis of Lhokseumawe State Polytechnic students toward the use of ChatGPT. The comparison is conducted due to the varied results of previous research, where the effectiveness of both algorithms largely depends on the data type and context. The model was developed using 9.800 external data collected from Twitter and Google Play Store, which were processed through text preprocessing and TF-IDF transformation stages, and then tested on 237 student questionnaire data as a case study. The initial evaluation showed that Naïve Bayes achieved an accuracy of 88% with a prediction time of 0,0063 seconds, while KNN recorded an accuracy of 83% with a prediction time of 0,4760 seconds. In the student questionnaire test, Naïve Bayes again outperformed with 79,75% accuracy compared to KNN’s 49,37%.