Analisis Sentimen Konsumen pada Rumah Makan di Mataram Menggunakan Algoritma K-Nearest Neighbor, Naïve Bayes, dan Support Vector Machine
Abstract
Consumer reviews on digital platforms can be used to identify customer perceptions of food quality, service, price, and restaurant comfort. This study used 1,006 reviews from 18 restaurants in Mataram City collected through web scraping from TripAdvisor. After data cleaning and selection, 780 reviews were used as the final dataset. The study aimed to analyze consumer review sentiment and compare the performance of K-Nearest Neighbor (K-NN), Naïve Bayes (NB), and Support Vector Machine (SVM) algorithms in classifying positive, negative, and neutral sentiments. A quantitative approach with a comparative experimental method was employed. The research stages included data collection, preprocessing, sentiment labeling based on lexicon and rating, feature extraction using Term Frequency-Inverse Document Frequency (TF-IDF), classification, and evaluation using a confusion matrix. Tests were conducted using 70:30, 80:20, and 90:10 data splits with accuracy, precision, recall, and F1-score as evaluation metrics. The results showed that SVM achieved the highest accuracy across all testing scenarios. The best performance was obtained with the 80:20 split, reaching 87.1% accuracy, 87.0% precision, 87.0% recall, and 86.0% F1-score.