Perbandingan Kinerja Algoritma Naive Bayes dan K-Nearest Neighbors untuk Analisis Sentimen Ulasan Aplikasi Lazada Menggunakan Python

Authors

  • Ahmad Apip Universitas Pamulang
  • Aa Kurniawan Universitas Pamulang

DOI:

https://doi.org/10.55606/jupti.v5i1.6437

Keywords:

K-Nearest Neighbor, Lazada, Naïve Bayes, Sentiment Analysis, TF-IDF

Abstract

The rapid growth of e-commerce in Indonesia has led to an increasing number of user reviews shared across various digital platforms, including the Lazada application. These textual reviews contain valuable insights into user satisfaction and experiences but have not been fully utilized for automated sentiment analysis. This study aims to compare the performance of the Naïve Bayes and K-Nearest Neighbor (KNN) algorithms in classifying user sentiment from Lazada reviews collected from the Google Play Store.The data preprocessing stages include text cleansing and case folding, tokenization, stopword removal, and stemming using the Sastrawi library. The cleaned text data were then transformed into numerical representations using the Term Frequency–Inverse Document Frequency (TF-IDF) method before classification. Model performance was evaluated using 10-Fold Cross Validation based on four key metrics: accuracy, precision, recall, and F1-score.The experimental results indicate that the Naïve Bayes algorithm achieved superior performance with an accuracy of 89.56%, precision of 89.53%, recall of 89.56%, and an F1-score of 89.53%. In contrast, the K-Nearest Neighbor (KNN) algorithm obtained an accuracy of 73.22%, precision of 75.21%, recall of 73.22%, and an F1-score of 65.64%. These findings suggest that Naïve Bayes demonstrates higher effectiveness and stability in classifying user sentiment on Lazada reviews compared to the KNN algorithm.

References

Abdillah, T., Khaira, U., & Hutabarat, B. F. (2024). Komparasi metode Naive Bayes dan K-Nearest Neighbors terhadap analisis sentimen pengguna aplikasi Zenius. Jurnal Processor, 19(1), 32–44. https://doi.org/10.33998/processor.2024.19.1.1596

Aggarwal, C. C. (2018). Machine learning for text. Springer. https://doi.org/10.1007/978-3-319-73531-3

Alamsyah, A., & Saviera, F. (n.d.). A comparison of Indonesia’s e-commerce sentiment analysis for marketing intelligence effort (case study of Bukalapak, Tokopedia and Elevenia) (pp. 1–6).

Alfaris, S., & Kusnawi. (2023). Komparasi metode KNN dan Naive Bayes terhadap analisis sentimen pengguna aplikasi Shopee. Indonesian Journal of Computer Science, 12(5), 2766–2776. https://doi.org/10.33022/ijcs.v12i5.3304

Alfarros, M., Naufalino, D., & Al-Husaini, M. (2025). Comparison of support vector machine, random forest, and XGBoost for sentiment analysis on Indodax. Journal of Computer Networks, Architecture and High Performance Computing, 7(2), 562–572. https://doi.org/10.47709/cnahpc.v7i2.5894

Aurelia, N., Sa, U., Fauzi, F., & Universitas Negeri Semarang. (2024). Analisis sentimen pada ulasan aplikasi menggunakan klasifikasi Naïve Bayes Tokopedia. Jurnal Teknologi dan Komputer, 44–51.

Calvin, W., & Maulana, A. (2024). Perbandingan analisis sentimen ulasan aplikasi Ajaib Kripto menggunakan metode Naïve Bayes dan K-Nearest Neighbor. JUMINTAL: Jurnal Manajemen Informatika dan Bisnis Digital, 3(2), 72–84. https://doi.org/10.55123/jumintal.v3i2.3965

Diastama, A., Firdaus, A., Rahmawan, R. D., Mahendra, Y. R., Cahyono, H. D., & Universitas Sebelas Maret. (2024). Klasifikasi sentimen analisis pada women’s e-commerce reviews dengan pendekatan machine learning. Jurnal Teknik Informatika (JUTIF), 5(6), 1549–1559. https://doi.org/10.52436/1.jutif.2024.5.6.2392

Enjelia, L., Cahyana, Y., Rahmat, & Wahiddin, D. (2025). Comparison of K-nearest neighbors and Naive Bayes classifier algorithms in sentiment analysis of 2024 election in Twitter (X). Journal of Applied Informatics and Computing, 9(3), 946–954. https://doi.org/10.30871/jaic.v9i3.9593

Kurniawan, D., & Santoso, B. (2021). Analisis sentimen ulasan aplikasi e-commerce menggunakan metode klasifikasi berbasis teks. Jurnal Teknologi Informasi dan Ilmu Komputer, 8(4), 789–798. https://doi.org/10.25126/jtiik.2021841234

Liu, B. (2020). Sentiment analysis: Mining opinions, sentiments, and emotions (2nd ed.). Cambridge University Press. https://doi.org/10.1017/9781108639286

Manning, C. D., Raghavan, P., & Schütze, H. (2008). Introduction to information retrieval. Cambridge University Press. https://doi.org/10.1017/CBO9780511809071

Mardiana, N. A., & Windari, W. O. (2024). Analisis sentimen terhadap ulasan e-commerce menggunakan metode machine learning. G-Tech: Jurnal Teknologi Terapan, 8(1), 186–195.

Neighbor, K., Adi, S., Mola, S., Polly, Y. T., & Atok, Y. C. (2025). Analisis sentimen terhadap data komentar publik mengenai isu UU Pilkada 2024 menggunakan metode Naïve Bayes. Jurnal Ilmu Manajemen dan Akuntansi Terapan (JIMAT), 5(3), 337–343. https://doi.org/10.47065/jimat.v5i3.514

Pratmanto, D., Widayanto, A., Kristania, Y. M., & Wijianto, R. (2024). Analisis perbandingan algoritma Naive Bayes dan KNN untuk analisis sentimen ulasan pengguna aplikasi Vidio di Google Play Store. CONTEN: Computer and Network Technology, 4(2), 119–124.

Rahmawati, A., Tamyiz, U. M. H., & Nugroho, I. M. (2023). Analisis sentimen tingkat kepopuleran e-commerce pada pengguna Twitter menggunakan algoritma Naive Bayes. Jurnal Aplikasi dan Teori Ilmu Komputer (JATIKOM), 6(1), 21–26. https://doi.org/10.17509/jatikom.v6i1.48867

Downloads

Published

2026-01-30

How to Cite

Ahmad Apip, & Kurniawan, A. (2026). Perbandingan Kinerja Algoritma Naive Bayes dan K-Nearest Neighbors untuk Analisis Sentimen Ulasan Aplikasi Lazada Menggunakan Python. Jurnal Publikasi Teknik Informatika, 5(1), 218–234. https://doi.org/10.55606/jupti.v5i1.6437