Comparison of KNN and Random Forest Algorithms on E-Commerce Service Chatbot
DOI:
https://doi.org/10.14421/jiska.2025.10.1.100-109Keywords:
Chatbot, E-Commerce, NLP, KNN, Random ForestAbstract
Technology heavily influences our lives, with the expansion of e-commerce being an important outcome that demands attention. Given the prevalence of smartphones equipped with messaging apps and fast networks, people often utilize these platforms to communicate with sellers, offering a convenient way for sellers to engage efficiently with a diverse customer base. Recognizing this trend, there is a need for digital transformation of services to improve operational efficiency. Thus, this study aimed to compare the efficiency of classification algorithms in e-commerce service chatbots. The researcher used machine learning techniques with KNN and Random Forest algorithms in this case. To assess the feasibility of the application, the chatbot results will be tested using the confusion matrix method to assess accuracy. From this study, it was obtained that the KNN method and calculating word weight using TF-IDF produces an accuracy value of 71.4%, thus confirming its feasibility.
References
Ahmad, G. N., Ullah, S., Algethami, A., Fatima, H., & Akhter, S. Md. H. (2022). Comparative Study of Optimum Medical Diagnosis of Human Heart Disease Using Machine Learning Technique With and Without Sequential Feature Selection. IEEE Access, 10, 23808–23828. https://doi.org/10.1109/ACCESS.2022.3153047
Astuti, R. N., & Fatchan, M. (2019). Perancangan Aplikasi Teknologi Chatbot Untuk Industri Komersial 4.0. Prosiding Seminar Nasional Teknologi Dan Sains (SNasTekS), 1(1), 339–348. https://journal.unusida.ac.id/index.php/snts/article/view/103
Baykara, B., & Güngör, T. (2022). Abstractive text summarization and new large-scale datasets for agglutinative languages Turkish and Hungarian. Language Resources and Evaluation, 56(3), 973–1007. https://doi.org/10.1007/s10579-021-09568-y
Bird, J. J., Ekárt, A., & Faria, D. R. (2023). Chatbot Interaction with Artificial Intelligence: human data augmentation with T5 and language transformer ensemble for text classification. Journal of Ambient Intelligence and Humanized Computing, 14(4), 3129–3144. https://doi.org/10.1007/s12652-021-03439-8
Chandra, A. Y., Kurniawan, D., & Musa, R. (2020). Perancangan Chatbot Menggunakan Dialogflow Natural Language Processing (Studi Kasus: Sistem Pemesanan pada Coffee Shop). Jurnal Media Informatika Budidarma, 4(1), 208. https://doi.org/10.30865/mib.v4i1.1505
Dogan, T., & Uysal, A. K. (2020). A novel term weighting scheme for text classification: TF-MONO. Journal of Informetrics, 14(4), 101076. https://doi.org/10.1016/j.joi.2020.101076
Fachreza, Moch. R. D., Suhartono, S., & Yaqin, M. A. (2023). Klasifikasi Sentimen Masyarakat Terhadap Proses Pemindahan Ibu Kota Negara (IKN) Indonesia pada Media Sosial Twitter Menggunakan Metode Naïve Bayes. JISKA (Jurnal Informatika Sunan Kalijaga), 8(3), 243–251. https://doi.org/10.14421/jiska.2023.8.3.243-251
Hoekstra, O., Hurst, W., & Tummers, J. (2022). Healthcare related event prediction from textual data with machine learning: A Systematic Literature Review. Healthcare Analytics, 2, 100107. https://doi.org/10.1016/j.health.2022.100107
Intan, P. K. (2019). Comparison of Kernel Function on Support Vector Machine in Classification of Childbirth. Jurnal Matematika “MANTIK,” 5(2), 90–99. https://doi.org/10.15642/mantik.2019.5.2.90-99
Jadhav, S. S., & Kalita, P. Ch. (2019). Design Thinking Approach in Planning E-commerce for Domestic Plumbing Services. Proceedings of the 2019 International Conference on E-Business and E-Commerce Engineering, 20–24. https://doi.org/10.1145/3385061.3385067
Jiang, M., Liang, Y., Feng, X., Fan, X., Pei, Z., Xue, Y., & Guan, R. (2018). Text classification based on deep belief network and softmax regression. Neural Computing and Applications, 29(1), 61–70. https://doi.org/10.1007/s00521-016-2401-x
Kumar, R., & Ali, M. M. (2020). A Review on Chatbot Design and Implementation Techniques. International Research Journal of Engineering and Technology (IRJET), 7(2), 2791–2800. https://www.irjet.net/archives/V7/i2/IRJET-V7I2592.pdf
Li, Q., & Zhang, Y. (2023). Improved Text Matching Model Based on BERT. Frontiers in Computing and Intelligent Systems, 2(3), 40–43. https://doi.org/10.54097/fcis.v2i3.5209
Mathew, R. B., Varghese, S., Joy, S. E., & Alex, S. S. (2019). Chatbot for Disease Prediction and Treatment Recommendation using Machine Learning. 2019 3rd International Conference on Trends in Electronics and Informatics (ICOEI), 851–856. https://doi.org/10.1109/ICOEI.2019.8862707
Mohey, D. (2016). Enhancement Bag-of-Words Model for Solving the Challenges of Sentiment Analysis. International Journal of Advanced Computer Science and Applications, 7(1), 244–252. https://doi.org/10.14569/IJACSA.2016.070134
Nugraha, K. A., & Sebastian, D. (2021). Chatbot Layanan Akademik Menggunakan K-Nearest Neighbor. Jurnal Sains Dan Informatika, 7(1), 11–19. https://doi.org/10.34128/jsi.v7i1.285
Rahardja, C. A., Juardi, T., & Agung, H. (2019). Implementasi Algoritma K-Nearest Neighbor pada Website Rekomendasi Laptop. Jurnal Buana Informatika, 10(1), 75–84. https://doi.org/10.24002/jbi.v10i1.1847
Rakhra, M., Gopinadh, G., Addepalli, N. S., Singh, G., Aliraja, S., Reddy, V. S. G., & Reddy, M. N. (2021). E-Commerce Assistance with a Smart Chatbot using Artificial Intelligence. 2021 2nd International Conference on Intelligent Engineering and Management (ICIEM), 144–148. https://doi.org/10.1109/ICIEM51511.2021.9445316
Reddy Karri, S. P., & Santhosh Kumar, B. (2020). Deep Learning Techniques for Implementation of Chatbots. 2020 International Conference on Computer Communication and Informatics (ICCCI), ICCCI(2020), 1–5. https://doi.org/10.1109/ICCCI48352.2020.9104143
Rizqullah, M. R., Purwarianti, A., & Aji, A. F. (2023). QASiNa: Religious Domain Question Answering Using Sirah Nabawiyah. 2023 10th International Conference on Advanced Informatics: Concept, Theory and Application (ICAICTA), 1–6. https://doi.org/10.1109/ICAICTA59291.2023.10390123
Rosyadi, H. E., Amrullah, F., Marcus, R. D., & Affandi, R. R. (2020). Rancang Bangun Chatbot Informasi Lowongan Pekerjaan Berbasis Whatsapp dengan Metode NLP (Natural Language Processing). Briliant: Jurnal Riset Dan Konseptual, 5(3), 619. https://doi.org/10.28926/briliant.v5i3.487
Singh, B., Olds, T., Brinsley, J., Dumuid, D., Virgara, R., Matricciani, L., Watson, A., Szeto, K., Eglitis, E., Miatke, A., Simpson, C. E. M., Vandelanotte, C., & Maher, C. (2023). Systematic review and meta-analysis of the effectiveness of chatbots on lifestyle behaviours. Npj Digital Medicine, 6(1), 118. https://doi.org/10.1038/s41746-023-00856-1
Sukmandhani, A. A., Lukas, Heryadi, Y., Suparta, W., & Wibowo, A. (2023). Classification Algorithm Analysis for Breast Cancer. E3S Web of Conferences, 388, 02012. https://doi.org/10.1051/e3sconf/202338802012
Tamizharasi, B., Jenila Livingston, L. M., & Rajkumar, S. (2020). Building a Medical Chatbot using Support Vector Machine Learning Algorithm. Journal of Physics: Conference Series, 1716(1), 012059. https://doi.org/10.1088/1742-6596/1716/1/012059
van Aken, B., Winter, B., Löser, A., & Gers, F. A. (2019). How Does BERT Answer Questions? Proceedings of the 28th ACM International Conference on Information and Knowledge Management, 1823–1832. https://doi.org/10.1145/3357384.3358028
Wang, G., Cao, L., Zhao, H., Liu, Q., & Chen, E. (2021). Coupling Macro-Sector-Micro Financial Indicators for Learning Stock Representations with Less Uncertainty. Proceedings of the AAAI Conference on Artificial Intelligence, 35(5), 4418–4426. https://doi.org/10.1609/aaai.v35i5.16568
Wibisono, A. B., & Fahrurozi, A. (2019). Perbandingan Algoritma Klasifikasi Dalam Pengklasifikasian Data Penyakit Jantung Koroner. Jurnal Ilmiah Teknologi Dan Rekayasa, 24(3), 161–170. https://doi.org/10.35760/tr.2019.v24i3.2393
Wibowo, B., Clarissa, H., & Suhartono, D. (2020). The Application of Chatbot for Customer Service in E-Commerce. Engineering, MAthematics and Computer Science (EMACS) Journal, 2(3), 91–95. https://doi.org/10.21512/emacsjournal.v2i3.6531
Wijanarko, R., & Afrianto, I. (2020). Rancang Bangun Aplikasi Chatbot Media Informasi Parenting Pola Asuh Anak Menggunakan Line. Matrix : Jurnal Manajemen Teknologi Dan Informatika, 10(1), 1–10. https://doi.org/10.31940/matrix.v10i1.1805
Yunanto, R., Wibowo, E. P., & Rianto, R. (2023). A Bert Model To Detect Provocative Hoax. Journal of Engineering Science and Technology, 18(5), 2281–2297. https://jestec.taylors.edu.my/Vol%2018%20Issue%205%20October%202023/18_5_03.pdf
Zhang, J., Zhang, J., Ma, S., Yang, J., & Gui, G. (2020). Chatbot Design Method Using Hybrid Word Vector Expression Model Based on Real Telemarketing Dat. KSII Transactions on Internet and Information Systems, 14(4), 1400–1418. https://doi.org/10.3837/tiis.2020.04.001
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2025 Fardan Zamakhsyari, Bagas Adi Makayasa, R. Abudullah Hamami, Muhammad Tulus Akbar, Andi Cahyono, Amirullah Amirullah, Muhammad Zida Hisyamuddin, Maria Ulfah Siregar

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
Authors who publish with this journal agree to the following terms as stated in http://creativecommons.org/licenses/by-nc/4.0
a. Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
b. Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
c. Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work.