Swasono Rahardjo, Dian Khairina Putri, Sisworo
Classification is the process of grouping objects based on certain properties or characteristics. This method used in various aspects of mathematics and statistics, such as number theory, data analysis, and pattern recognition. Naive Bayes and K-Nearest Neighbors (KNN) are two popular classification methods. The Naive Bayes classifier has weaknesses that can be mitigated by the KNN method, and vice versa. Therefore, this study aims to compare the two classification methods, Naive Bayes and KNN, based on their accuracy. The novelty of this study lies in comparing K-Nearest Neighbour and Naive Bayes for classifying consumer reviews on Tokopedia, offering insights into their effectiveness in handling unique text data and improving e-commerce classification models. The research design for this study comprises seven stages: data collection, data input, preprocessing, data labeling, data weighting, classification, and accuracy testing. For data collection, this study uses 197 customer review data obtained from one of the online forums, specifically the e-commerce platform Tokopedia. The results show that of the 197 processed review data, positive reviews account for 39% more than reviews with negative sentiment, indicating that 137 buyers have a positive impression. Additionally, the results indicate that Naive Bayes performs slightly better than KNN for this specific dataset. Naive Bayes achieved an accuracy of 73.3%, while KNN achieved an accuracy of 65%. © 2025 American Institute of Physics Inc.. All rights reserved.
Department of Mathematics, Universitas Negeri Malang, Jl. Semarang 5, Malang, 65145, Indonesia