Penerapan Algoritma K-Nearest Neighbor untuk Analisis Sentimen Ulasan Produk Elektronik pada Platform E-Commerce - Octavia, Noer Fotin; Berlilana (Jurnal Algoritma, 2025)
The study aims to evaluate user sentiment toward Samsung products on the Tokopedia e-commerce platform using the K-Nearest Neighbor (KNN) algorithm. E-commerce plays a crucial role in modern trade, where consumer reviews provide insights into their level of satisfaction. The KNN method is applied to classify reviews into positive, negative, and neutral sentiment categories based on the collected review data. The research procedure includes collecting 2,200 Samsung product reviews from Tokopedia, followed by preprocessing steps such as tokenization, normalization, stopword removal, stemming, and data cleaning. The data is then weighted using TF-IDF before being classified with KNN. The results show that the KNN model achieved the highest accuracy of 91.35 percent at K=3, while K=5 yielded 90.38 percent and K=7 reached 90.14 percent. The model performed exceptionally well in detecting positive sentiment, with 100 percent precision and recall and an F1-score of 96 percent, although its performance was less optimal for negative and neutral sentiments. Overall, KNN proved effective in analyzing sentiment in Tokopedia product reviews, demonstrating higher accuracy than other methods used in previous studies and showing the capability to capture local patterns within a single-brand dataset. Nevertheless, further methodological improvements and enhanced data processing are needed to achieve more precise and balanced performance across all sentiment categories.