Journal of Advanced Computer Knowledge and Algorithms
Vol. 3 No. 2 (2026): Journal of Advanced Computer Knowledge and Algorithms - April 2026 (In Press)

Comparison of the K-Nearest Neighbor and Random Forest Methods in Classifying the Best Selling Medicines at Khan Pharmacy Matang Glumpang Dua

Putri, Anya Regina (Unknown)
Rozzi Kesuma Dinata (Unknown)
Maryana (Unknown)



Article Info

Publish Date
01 Apr 2026

Abstract

Khan Matang Glumpang Dua Pharmacy faces difficulties in analyzing drug sales patterns that affect inventory efficiency and customer satisfaction. The need to anticipate demand and reduce the risk of stockouts or excess stock requires an effective classification system for best-selling drugs. This study aims to test the K-Nearest Neighbor (KNN) and Random Forest methods to perform and find the best classification model. The data used in this study consisted of 382 data points. This study compared two classification models on pharmacy sales data. The K-Nearest Neighbor (KNN) model was tested using the parameter k=3, while the Random Forest model was tested with 100 trees and a max depth of 5. The results showed that the KNN and Random Forest (RF) algorithms. The Random Forest (RF) model outperformed KNN on all metrics: RF achieved an Accuracy and F1-Score of 94.81%, while KNN recorded an Accuracy of 93.51% and an F1-Score of 93.44%.

Copyrights © 2026






Journal Info

Abbrev

jacka

Publisher

Subject

Computer Science & IT

Description

JACKA journal published by the Informatics Engineering Program, Faculty of Engineering, Universitas Malikussaleh to accommodate the scientific writings of the ideas or studies related to informatics science. JACKA journal published many related subjects on informatics science such as (but not ...