Comparison of K-Nearest Neighbor and Decision Tree Methods using Principal Component Analysis Technique in Heart Disease Classification
Abstract
Heart disease has become a global health issue that can threaten anyone, regardless of age. Numerous research efforts have been made to develop classification methods that can aid in diagnosing heart disease. In this study, we compared two classification methods, namely K-Nearest Neighbor (KNN) and Decision Tree, by applying Principal Component Analysis (PCA) technique to the heart disease classification. The dataset used contains relevant clinical attributes. After analyzing the dataset and performing data preprocessing, we applied PCA to reduce the dataset's dimensions. PCA models with KNN and Decision Tree were implemented and evaluated using performance metrics such as Confusion Matrix, F1 Score, and Accuracy. The analysis results showed that the PCA model with Decision Tree outperformed the PCA model with KNN in terms of accuracy. The Decision Tree model successfully classified all data correctly, while KNN had some misclassifications. This research recommends using the PCA model with Decision Tree for heart disease classification with the best performance. However, further research with larger datasets is needed for a deeper understanding
Downloads
References
F. C. Anggoro, "Penerapan Metode K-Nearest Neighbour Untuk Menganalisis Investasi Budidaya Lobster Air Tawar Berbasis Web," JATI (Jurnal Mahasiswa Teknik Informatika), vol. Vol. 3 No. 1, no. 106, pp. 104-109, 2019.
N. M. Pane, M. S. S. Umam and F. N. Fauziah, "Perancang Sistem Pakar Diagnosis Kerusakan Perangkat Keras Menggunakan Pohon Keputusan," Jurnal METHODIKA, vol. Vol. 6 No. 2, no. 30, pp. 29-33, 2020.
A. W. Alwi and A. Sauddin, "Pengembangan Media Pembelajaran Analisis Komponen Utama Berbasis Web Menggunakan Shiny R," jurnal Matematika dan Statistika serta Aplikasinya, vol. Vol.10 No. 2, no. 64 , pp. 63-72, 2022.
R. Kosasih, "Kombinasi Metode Isomap Dan Knn Pada Image Processing Untuk Pengenalan Wajah," CESS (Journal of Computer Engineering System and Science), vol. Vol. 5 No. 2, pp. 166-170, 2020.
D. Cahyanti, A. Rahmayanti and S. A. Husniar, "Analisis performa metode Knn pada Dataset pasien pengidap Kanker Payudara," Indonesian Journal of Data and Science, Vols. Vol 1, No 2, pp. 39-43, 2020.
D. G. Pradana, M. L. Alghifari, M. . F. Juna and S. D. Palaguna, "Klasifikasi Penyakit Jantung Menggunakan Metode Artificial Neural Network," Indonesian Journal of Data and Science (IJODAS), Vols. Vol 3, No 2, pp. 55-60, 2022.
D. P. Utomo, P. Sirait and R. Yunis, "Reduksi Atribut Pada Dataset Penyakit Jantung dan Klasifikasi Menggunakan Algoritma C5.0," Jurnal Media Informatika Budidarma, Vols. Volume 4, Nomor 4, pp. 994-1006, 2020.
Derisma, "Perbandingan Kinerja Algoritma untuk Prediksi Penyakit Jantung dengan Teknik Data Mining," Journal of Applied Informatics and Computing (JAIC), Vols. Vol.4, No.1, pp. 84-88, 2020.
H. Azis, P. F. Fattah and I. P. Putri, "Performa Klasifikasi K-NN dan Cross-validation pada Data Pasien Pengidap Penyakit Jantung," ILKOM Jurnal Ilmiah, vol. Vol. 12 No. 2, pp. 81-86, 2020.
L. Andiani, S. and D. P. Rini, "Analisis Penyakit Jantung Menggunakan Metode KNN Dan Random Forest," Annual Research Seminar (ARS) 2019 Fakultas Ilmu Komputer UNSRI, vol. Vol.5 No.1, pp. 165-169, 2019.
F. Handayani, K. S. Kusuma, H. L. Asbudi, R. . G. Purnasiwi, R. Kusuma, A. Sunyoto and W. M. Pradnya, "Komparasi Support Vector Machine, Logistic Regression Dan Artificial Neural Network dalam Prediksi Penyakit Jantung," JEPIN (Jurnal Edukasi dan Penelitian Informatika), vol. Vol. 7 No. 3, pp. 329-334, 2021.
Sahar, "Analisis Perbandingan Metode K-Nearest Neighbor dan Naïve Bayes Classiffier pada Data Set Penyakit Jantung," Indonesian Journal of Data and Science (IJODAS), Vols. Vol 1, No 3, pp. 79-86, 2020.
N. M. Sunariadi, S. N. Fadilah and D. C. R. Novitasari, "Analisis Resiko Kanker Serviks Menggunakan PCA-ANFIS Berdasarkan Historical Medical Record," JURNAL MEDIA INFORMATIKA BUDIDARM, vol. 6, pp. 1349-1355, 2022.
A. Islamiyati, S. Sahriman and S. Oktoni, "Studi Longitudinal Pada Analisis Data Gula Darah Pasien Diabetes melalui Principal Component Analysis," Jambura Journal Of Mathematics, vol. 4, pp. 41-49, 2022.
S. Mutmainah, "Penanganan Imbalance Data Pada Klasifikasi Kemungkinan Penyakit Stroke," Jurnal SNATi, vol. 1, pp. 10-16, 2021.
A. L. Unihehu and I. Suharjo, "Klasifikasi Jenis Ikan Berbasis Jaringan Saraf Tiruan Menggunakan Algoritma Principal Component Analysis (PCA)," Jurnal Ilmiah Ilmu Komputer, vol. 7, pp. 27-32, 2021.

Copyright (c) 2023 Indonesian Journal of Data and Science

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
License and Copyright Agreement
By submitting a manuscript to the Indonesian Journal of Data and Science (IJODAS), the author(s) confirm and agree to the following:
- All co-authors have given their consent to enter into this agreement.
- The submitted manuscript has not been formally published elsewhere, except as an abstract, thesis, or in the context of a lecture, review, or overlay journal.
- The manuscript is not currently under review or consideration by another journal or publisher.
- All authors have approved the manuscript and its submission to IJODAS, and where applicable, have received institutional approval (tacit or explicit) from affiliated organizations.
- The authors have secured appropriate permissions to reproduce any third-party material included in the manuscript that may be under copyright.
- The authors agree to abide by the licensing and copyright terms outlined below.
Copyright Policy
Authors who publish in IJODAS retain the copyright to their work and grant the journal the right of first publication. The published work is simultaneously licensed under a Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0) , which permits others to share and adapt the work for non-commercial purposes, with proper attribution to the authors and the initial publication in this journal.
Reuse and Distribution
- Authors may enter into separate, additional contractual arrangements for non-exclusive distribution of the journal-published version of the article (e.g., institutional repositories, book chapters), provided there is proper acknowledgment of its initial publication in IJODAS.
- Prior to and during the submission process, we encourage authors to archive preprints and accepted versions of their work on personal websites or institutional repositories. This method supports scholarly communication, visibility, and early citation.
For more details on the terms of the Creative Commons license used by IJODAS, please visit the official license page.