Comparison of Drug Type Classification Performance Using KNN Algorithm


  • Febri Aldi Universitas Putra Indonesia "YPTK" Padang
  • Irohito Nozomi Universitas Putra Indonesia Yptk, Padang
  • Soeheri Universitas Potensi Utama, Medan, Indonesia




Confusion Matrix, Cross Validation, Drug, KNN, Machine Learning


The error of decommissioning is a serious problem that is often faced in medicine. In the face of these problems, information technology has a very important role. One of the information technologies that can be used is to use the machine learning classification algorithm K-Nearest Neighbor KNN. KNN is a type of machine learning algorithm that can be applied to problems with classification and regression prediction. The classification of types of drugs for patients greatly affects the health of the patient. The patient data is processed and transformed to numbers, which are then divided into training data and test data from 90:10, 80:20, 70:30 and using the Cross Validation model. KNN works through the nearest neighboring value with a value of k = 3 calculated by the calculation of Euclidean Distance, and then evaluated using the Confusion Matrix. The performance of the KNN algorithm resulted in the highest Accuracy value of 98.33%, a Precision value of 98.8%, a Recall value of 96.2%, and an F-measure value of 97.48%. The performance is obtained from the sharing of training data and 90:10 test data. The data share results in high performance compared to other data shares, including using the Cross Validation model. And the lower the k value, the higher the value of the resulting performance. The results show that the performance of the KNN algorithm is working well.

GS Cited Analysis


Download data is not yet available.


Amin, M. Z., & Ali, A. (2017). Performance Evaluation of Supervised Machine Learning Classifiers for Predicting Healthcare Operational Decisions Performance Evaluation of Supervised Machine Learning Classifiers for Predicting Healthcare Operational Decisions. Wavy AI Research Foundation, (January).

Anita, R., & Bajusz, D. (2019). Multi-Level Comparison of Machine Learning Classifiers and Their Performance Metrics. Molecules, 24, 1–18.

Aprilia, Nursalam, & Panji, A. C. (2016). OBAT DI RSUD SIDOARJO ( Right Medication Related to Drug Centralized in RSUD Sidoarjo ). Jurnal INJEC, 1(2), 187–196.

Arslan, H., & Arslan, H. (2021). Engineering Science and Technology , an International Journal A new COVID-19 detection method from human genome sequences using CpG island features and KNN classifier. Engineering Science and Technology, an International Journal, 24(4), 839–847.

Baumann, K. (2003). Cross-validation as the objective function for variable-selection techniques. Trends in Analytical Chemistry, 22(6), 395–406.

Chicco, D., Tötsch, N., & Jurman, G. (2021). The Matthews correlation coefficient ( MCC ) is more reliable than balanced accuracy , bookmaker informedness , and markedness in two-class confusion matrix evaluation. BioData Mining, 14(13), 1–22.

D, T. F. P., D, R. S. P., & D, S. B. P. (2009). Transcription Errors Observed in a Teaching Hospital Fanak. Arch Iranian Med, 12(12), 173–175.

Hossain, E., & Rahaman, M. A. (2019). A Color and Texture Based Approach for the Detection and Classification of Plant Leaf Disease Using KNN Classifier. International Conference on Electrical, Computer and Communication Engineering (ECCE), 7–9.

Houcine, T., Mezache, A., & Oudira, H. (2019). ScienceDirect ScienceDirect Model Selection of Sea Clutter Using Cross Validation Method. Procedia Computer Science, 158, 394–400.

Kartini, D., Farmadi, A., & Nugrahadi, D. T. (2022). Perbandingan Nilai K pada Klasifikasi Pneumonia Anak Balita. 10(1), 47–53.

Mao, X., Jia, P., Zhang, L., Zhao, P., & Chen, Y. (2015). An Evaluation of the Effects of Human Factors and Ergonomics on Health Care and Patient Safety Practices : A Systematic Review. PLOS ONE, 1–19.

Murugan, A., Nair, S. A. H., & Kumar, K. P. S. (2019). Detection of Skin Cancer Using SVM , Random Forest and kNN Classifiers. Journal of Medical Systems, 43, 269.

Patel, I., & Balkrishnan, R. (2010). Medication Error Management around the Globe : An Overview. Indian Journal of Pharmaceutical Sciences, 539–545.

Pavaloiu, I. B., Ancuceanu, R., Enache, C. M., & Vasilateanu, A. (2017). Important shape features for Romanian medicinal herb identification based on leaf image. 2017 E-Health and Bioengineering Conference, EHB 2017, 599–602.

Poulter, N. R., & Lackland, D. T. (2017). Medication Without Harm : WHO ’ s Third Global Patient Safety Challenge. The Lancet, 389(10080), 1680–1681.

Putri, H., Purnamasari, A. I., Dikananda, A. R., Nurdiawan, O., & Anwar, S. (2021). Penerima Manfaat Bantuan Non Tunai Kartu Keluarga Sejahtera Menggunakan Metode NAÏVE BAYES dan KNN. Building of Informatics, Technology and Science (BITS), 3(3), 331–337.

Shamrat, F. M. J. M., & Chakraborty, S. (2021). Sentiment analysis on twitter tweets about COVID-19 vaccines using NLP and supervised KNN classification algorithm. Indonesian Journal of Electrical Engineering and Computer Science, 23(1), 463–470.

Telaumbanua, F. D., Hulu, P., Nadeak, T. Z., Lumbantong, R. R., & Dharma, A. (2019). Penggunaan Machine Learning. Jurnal Teknologi Dan Ilmu Komputer, 3(1), 57–64.

Vaishnnave, M. P., & Devi, K. S. (2019). Detection and Classification of Groundnut Leaf Diseases using KNN classifier. Proceeding of International Conference on Systems Computation Automation and Networking, 1–5.

Vaishnnave, M. P., Suganya Devi, K., Srinivasan, P., & Arutperumjothi, G. (2019). Detection and classification of groundnut leaf diseases using KNN classifier. 2019 IEEE International Conference on System, Computation, Automation and Networking, ICSCAN 2019.

Voulodimos, A., Doulamis, N., Doulamis, A., & Protopapadakis, E. (2018). Deep Learning for Computer Vision : A Brief Review. Computational Intelligence and Neuroscience.

Wirdiani, N. K. A., Hridayami, P., Widiari, N. P. A., Rismawan, K. D., Candradinata, P. B., & Jayantha, I. P. D. (2019). Face Identification Based on K-Nearest Neighbor. Scientific Journal of Informatics, 6(2), 150–159.

Xing, W., & Bei, Y. (2019). Medical Health Big Data Classification Based on KNN Classification Algorithm. IEEE Access, 8.

Xiong, L., & Yao, Y. (2021). Study on an adaptive thermal comfort model with K-nearest-neighbors ( KNN ) algorithm. Building and Environment, 202(December 2020), 108026.

Yuliati, I. F., & Sihombing, P. R. (2021). Penerapan Metode Machine Learning dalam Klasifikasi Risiko Kejadian Berat Badan Lahir Rendah di Indonesia Implementation of Machine Learning Method in Risk Classification on Low Birth weight in Indonesia. Matrik: Jurnal Manajemen, Teknik Informatika, Dan Rekayasa Komputer, 20(2), 417–426.

Zhou, L. J., Li, X. Da, Zhang, J. N., Huo, W. J., & Chen, Z. (2020). ScienceDirect The Lao Text Classification Method Based on KNN. Procedia Computer Science, 166, 523–528.


Crossmark Updates

How to Cite

Aldi, F., Nozomi, I. . ., & Soeheri, S. (2022). Comparison of Drug Type Classification Performance Using KNN Algorithm. Sinkron : Jurnal Dan Penelitian Teknik Informatika, 7(3), 1028-1034.