Sentiment analysis has become increasingly important in e-commerce because product reviews influence consumer purchasing decisions and provide feedback for sellers to evaluate product quality and improve services. The large number of online reviews on e-commerce platforms makes manual analysis inefficient and time-consuming, thereby requiring automated sentiment classification methods that are accurate and computationally efficient. This study aims to compare the performance of the Multinomial Naïve Bayes and Random Forest algorithms in classifying sentiment in Tokopedia product reviews using the PRDECT-ID dataset, which consists of 5,400 Indonesian-language reviews. The research methodology involved several preprocessing stages, including case folding, cleaning, normalization, tokenization, stopword removal, and stemming using the Sastrawi library, followed by feature extraction using the TF-IDF method. The dataset was divided using a stratified random split approach with 80% training data and 20% testing data, and the models were evaluated using accuracy, precision, recall, F1-score, and ROC-AUC metrics. The results indicate that Multinomial Naïve Bayes outperformed Random Forest, achieving an accuracy of 93.59%, precision of 91.82%, recall of 94.65%, F1-score of 93.21%, and ROC-AUC of 0.9813. In comparison, Random Forest achieved an accuracy of 90.35%, precision of 85.63%, recall of 93.67%, F1-score of 89.47%, and ROC-AUC of 0.9635. In addition to its superior classification performance, Multinomial Naïve Bayes also demonstrated greater computational efficiency with significantly faster training time. These findings suggest that Multinomial Naïve Bayes is a more effective approach for sentiment classification of Indonesian-language e-commerce product reviews.
Copyrights © 2026