Perbandingan Algoritma Naive Bayes dan K-Nearest Neighbors dalam Analisis Sentimen Ulasan Aplikasi Gojek
Abstrak
Sentiment analysis of mobile app reviews helps understand public perceptions of digital service quality. This study compares two machine learning algorithms, Naive Bayes (NB) and K-Nearest Neighbors (KNN), for classifying sentiment in Gojek app reviews from the Google Play Store. The dataset includes 5,000 reviews (1-star as negative and 5-star as positive), processed through Indonesian text preprocessing steps: case folding, tokenization, stopword removal, stemming with PySastrawi, and TF-IDF feature extraction using unigrams and bigrams. After cleaning, 4,685 valid reviews remained, split into 80% training and 20% testing, producing 3,322 features. Results show that Naive Bayes (MultinomialNB, α = 1.0) outperforms KNN, achieving 89.43% accuracy, 90.09% precision, 89.43% recall, and 89.34% F1-score, with a 5-fold cross-validation score of 91.22%. Meanwhile, KNN (k = 7, cosine metric) achieves 86.77% accuracy, 86.78% precision, 86.77% recall, and 86.75% F1-score, with a cross-validation score of 87.83%. Overall, Naive Bayes proves more effective for high-dimensional Indonesian text classification using TF-IDF.
Identifier
- OpenAlex: https://openalex.org/W7172250147
- DOI: https://doi.org/10.46880/jmika.vol10no1.pp186-191

