Perbandingan Naïve Bayes dan Random Forest untuk Klasifikasi Sentimen Ulasan Produk Amazon Fire HD 7 - Khabib Tri Anggara Anggara; Rahmad Syukur Gea; Hendra S upendar; Riza Fahlapi (LKP KARYA PRIMA KURSUS, 2026)
Product reviews on e-commerce platforms contain valuable consumer opinions that are important for both prospective buyers and brand managers. However, the large volume of reviews makes manual analysis difficult. This study compares the performance of the Naïve Bayes and Random Forest algorithms in classifying the sentiment of Amazon Fire HD 7 product reviews into three categories: positive, neutral, and negative. A total of 30,846 English-language reviews were processed through text preprocessing and TF-IDF feature weighting, then split using a stratified 80:20 ratio. Both models were evaluated using accuracy, as well as macro-averaged precision, recall, and F1-score. The results indicate metric-dependent performance differences: Random Forest achieved higher accuracy (0.856 vs. 0.770), whereas Naïve Bayes outperformed Random Forest in terms of macro F1-score (0.481 vs. 0.447), which is the primary evaluation metric for imbalanced datasets. Random Forest tended to predict the majority class (positive), resulting in weaker performance on the neutral and negative classes, while Naïve Bayes produced more balanced predictions across all classes. These findings demonstrate that accuracy can be misleading when evaluating imbalanced datasets and that the macro F1-score provides a more representative measure for assessing multiclass sentiment classification performance.