Performa Klasifikasi K-NN dan Cross Validation pada Data Pasien Pengidap Penyakit Jantung

Huzain Azis(1*); Purnawansyah Purnawansyah(2); Farniwati Fattah(3); Inggrianti Pratiwi Putri(4);

(1) Universitas Muslim Indonesia
(2) Universitas Muslim Indonesia
(3) Universitas Muslim Indonesia
(4) Universitas Muslim Indonesia
(*) Corresponding Author



Globally, the number one cause of death each year is cardiovascular disease. Cardiovascular disease is a disease caused by impaired function of the heart and blood vessels, such as coronary heart disease, heart failure or heart failure, hypertension and stroke. The purpose of this study was to measure the performance of accuracy, precision, recall and f-measure of the K-NN and Crossvalidation methods on a dataset of cardiovascular patients. The dataset used was 1000 records consisting of 11 attributes (age, gender, height, etc.) cardiovascular and non cardiovascular patient data, the dataset was obtained from the UCI Machine Learning Repository managed by the Hungarian Institute of Cardiology Budapest: Andras Janosi, MD, University Hospital, Zurich, Switzerland. The steps taken are: dividing the simulation ratio of the dataset to 20:80, 50:50 and 80:20, applying crossvalidation (k-fold = 10) and classification using the K-NN method (k = 2 to K = 900). The research results from the simulation of the dataset ratio 50:50 obtained an accuracy value of 82%, 82% precision, 82% recall and 80% f-measure at a value of K = 13, then the research results from the simulation of the dataset ratio 20:80 obtained an accuracy value of 87%, 87% precision, 97% recall and 92% f-measure at the value of K = 3, and the results of research from the simulation of the dataset ratio 80:20 obtained an accuracy value of 91%, 92% precision, 60% recall and 72% f-measure at the value K = 5.


K-Nearest Neighbor; Crossvalidation; analisis performa; Penyakit Cardiovascular


Full Text:


Article Metrics

Abstract view: 4027 times
PDF view: 1353 times

Digital Object Identifier




M. Lestari, “Penerapan Algoritma Klasifikasi Nearest Neighbor (K-NN) Untuk Mendeteksi Penyakit Jantung,” Fakt. Exacta, vol. 7, no. September 2010, pp. 366–371, 2014.

Hasran, “Klasifikasi Penyakit Jantung Menggunakan Metode K-Nearest Neighbor,” Indones. J. Data Sci., vol. 1, no. 1, pp. 1–4, 2020.

F. T. Admojo and Ahsanawati, “Klasifikasi Aroma Alkohol Menggunakan Metode KNN,” Indones. J. Data Sci., vol. 1, no. 2, pp. 34–38, 2020.

A. Maulida, “Penerapan Metode Klasifikasi K-Nearest Neigbor pada Dataset Penderita Penyakit Diabetes,” Indones. J. Data Sci., vol. 1, no. 2, pp. 29–33, 2020.

D. Cahyanti, A. Rahmayani, and S. Ainy, “Analisis performa metode Knn pada Dataset pasien pengidap Kanker Payudara,” Indones. J. Data Sci., vol. 1, no. 2, pp. 39–43, 2020.

Y. Lukito and A. R. Chrismanto, “Perbandingan Metode-Metode Klasifikasi untuk Indoor Positioning System,” J. Tek. Inform. dan Sist. Inf., vol. 1, no. 2, pp. 123–131, 2015, doi: 10.28932/jutisi.v1i2.373.

N. Fadhillah, H. Azis, and D. Lantara, “Validasi Pencarian Kata Kunci Menggunakan Algoritma Levenshtein Distance Berdasarkan Metode Approximate String Matching,” Pros. Semin. Nas. Ilmu Komput. dan Teknol. Inf., vol. 3, no. 2, pp. 3–7, 2018.

A. A. Karim, H. Azis, and Y. Salim, “Kinerja Metode C4.5 dalam Penyaluran Bantuan Dana Bencana 1,” Pros. Semin. Nas. Ilmu Komput. dan Teknol. Inf., vol. 3, no. 2, pp. 84–87, 2018.

A. Fitria and H. Azis, “Analisis Kinerja Sistem Klasifikasi Skripsi menggunakan Metode Naïve Bayes Classifier,” Pros. Semin. Nas. Ilmu Komput. dan Teknol. Inf., vol. 3, no. 2, pp. 102–106, 2018.

M. M. Baharuddin, T. Hasanuddin, and H. Azis, “Analisis Performa Metode K-Nearest Neighbor untuk Identifikasi Jenis Kaca,” Ilk. J. Ilm., vol. 11, no. 28, pp. 269–274, 2019.

H. Azis, F. T. Admojo, and E. Susanti, “Analisis Perbandingan Performa Metode Klasifikasi pada Dataset Multiclass Citra Busur Panah,” Techno.Com, vol. 19, no. 3, 2020.

M. J. Hartmann and G. Carleo, “Neural-Network Approach to Dissipative Quantum Many-Body Dynamics,” Phys. Rev. Lett., vol. 122, no. 25, p. 250502, Jun. 2019, doi: 10.1103/PhysRevLett.122.250502.

K. Crammer, “On the algorithmic implementation of multiclass kernel-based vector machines,” J. Mach. Learn. Res. - JMLR, vol. 2, no. 2, pp. 265–292, 2002.

A. Tharwat, “Linear vs. quadratic discriminant analysis classifier: a tutorial,” Int. J. Appl. Pattern Recognit., vol. 3, no. 2, p. 145, 2016, doi: 10.1504/ijapr.2016.079050.

P. A. Flach and M. Kull, “Precision-Recall-Gain curves: PR analysis done right,” Adv. Neural Inf. Process. Syst., vol. 2015-Janua, pp. 838–846, 2015.

L. Nurhayati and H. Azis, “Perancangan Sistem Pendukung Keputusan Untuk Proses Kenaikan Jabatan Struktural Pada Biro Kepegawaian,” Semin. Nas. Teknol. Inf. dan Multimed., pp. 6–7, 2016.

A. Tharwat, “Classification assessment methods,” Appl. Comput. Informatics, 2018, doi: 10.1016/j.aci.2018.08.003.

K. H. Brodersen, C. S. Ong, K. E. Stephan, and J. M. Buhmann, “The balanced accuracy and its posterior distribution,” Proc. - Int. Conf. Pattern Recognit., pp. 3121–3124, 2010, doi: 10.1109/ICPR.2010.764.

T. Hastie, S. Rosset, J. Zhu, and H. Zou, “Multi-class AdaBoost,” Stat. Interface, vol. 2, no. 3, pp. 349–360, 2009, doi: 10.4310/sii.2009.v2.n3.a8.

R. Puri and K. Khamrui, “Application of Quantitative Descriptive Analysis (QDA), Principal Component Analysis (PCA) and Response Surface Methodology (RSM) in standardization of cham-cham making.,” 2015.

S. Paembonan et al., “Combination of K-Means and Profile Matching for Drag Substitution,” in 2018 2nd East Indonesia Conference on Computer and Information Technology (EIConCIT), Nov. 2018, pp. 180–183, doi: 10.1109/EIConCIT.2018.8878539.

D. Chicco and G. Jurman, “The advantages of the Matthews correlation coefficient (MCC) over F1 score and accuracy in binary classification evaluation,” BMC Genomics, vol. 21, no. 1, pp. 1–13, 2020, doi: 10.1186/s12864-019-6413-7.


  • There are currently no refbacks.

Copyright (c) 2020 Huzain Azis

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.