Implementation of K Nearest Neighbor in Detecting Heart Disease with Various Training Data

Authors

DOI:

https://doi.org/10.24114/cess.v8i2.44303

Keywords:

Heart disease, Machine learning, K Nearest Neighbor, Feature

Abstract

Salah satu organ penting dalam tubuh manusia adalah jantung, Jika jantung mengalami gangguan maka dapat menyebabkan penyakit jantung. Untuk mendeteksi adanya penyakit jantung biasanya dilakukan dengan berkonsultasi dengan tenaga medis. Akan tetapi dengan semakin banyaknya pasien di rumah sakit akan dapat memperlambat pendeteksian penyakit jantung. Oleh karena itu dibutuhkan suatu sistem yang dapat membantu tenaga medis dalam mempercepat pendeteksian penyakit jantung. Dalam penelitian ini diusulkan untuk menggunakan pendekatan machine learning seperti metode K Nearest Neighbor (KNN) dalam mendeteksi penyakit jantung. Data yang digunakan sebanyak 1025 pasien dengan 13 fitur seperti umur, jenis kelamin, rasa sakit di dada, tekanan darah saat sedang istirahat, kadar kolesterol, gula darah, hasil elektrografik saat sedang istirahat, detak jantung maksimal, jika mengalami nyeri dada saat latihan, depresi yang diinduksi oleh latihan relatif, kemiringan puncak ST segmen, jumlah pembuluh darah yang berwarna setelah diwarnai flourosopy dan tipe kerusakan pembuluh darah. Pada penelitian ini dilakukan tiga skema pembagian data latih dan data uji dengan rasio 60:40, 70:30 dan 80:20. Berdasarkan hasil pengujian diperoleh bahwa tingkat akurasi, presisi dan recall tertinggi terjadi Ketika rasio data latih dan data uji 70:30 yaitu sebesar 97,0779% untuk akurasi, 97,9166% untuk presisi dan 95,9183% untuk recall.One of the important organs in humans is the heart. If the heart is disturbed, it can cause heart disease. To detect the presence of heart disease is usually done in consultation with doctor. However, with the increasing number of patients in the hospital, it will be able to slow down the detection of heart disease. Therefore, we need a system that can assist doctors in accelerating the detection of heart disease. In this study, we propose to use a machine learning approach i.e., K Nearest Neighbor (KNN) method in detecting heart disease. The data used were 1025 patients with 13 features i.e., age, gender, chest pain, blood pressure, cholesterol, blood sugar, electrographic results, maximum heart rate, if you experience chest pain during exercise, depression which exercise-induced relative, peak slope, number of blood vessels after fluoroscopy and type of vessel damage. In this study, we have three schemes in divide training data and test data with ratios of 60:40, 70:30 and 80:20. Based on the test results, it was found that the highest levels of accuracy, precision and recall occurred when the ratio of training data and test data was 70:30, which was 97.0779% for accuracy, 97,9166 for precision and 95,9183% for recall.

Author Biographies

Rifki Kosasih, Universitas Gunadarma

Fakultas Teknologi Industri, Departemen Informatika, Universitas Gunadarma

Iffatul Mardhiyah, Universitas Gunadarma

Fakultas Teknologi Industri, Departemen Informatika, Universitas Gunadarma

References

T. Aniamarta, A. S. Huda, and F. L. Aqsha, œReview Artikel : Penyebab dan Pengobatan Serangan Jantung, J. Biol. Samudra, vol. 4, no. 1, pp. 22“31, 2022.

S. R. J. I. Alham, E. Yosrita, and R. Cahyaningtyas, œSistem Diagnosis Penyakit Jantung Koroner Dengan Menggunakan Algoritma C4.5 Berbasis Website (Studi Kasus: RSUD Dr. Soedarso Pontianak), J. Pengkaj. dan Penerapan Tek. Inform., vol. 14, no. 2, pp. 214“222, 2021.

L. Ghani, M. Dewi Susilawati, and H. Novriani, œFaktor Risiko Dominan Penyakit Jantung Koroner di Indonesia, Bul. Penelit. Kesehat., vol. 44, no. 3, pp. 153“164, 2016.

M. A. Bianto, Kusrini, and Sudarmawan, œPerancangan Sistem Klasifikasi Penyakit Jantung Mengunakan Naïve Bayes, Citec J., vol. 6, no. 1, pp. 75“83, 2019.

World Health Organization (WHO), œData and Statistics, 2020. [Online]. Available: http://www.euro.who.int/en/health-topics/noncommunicable-diseases/cardiovascula rdiseases/data-and-statistics. [Diakses 25 Maret 2023].

Kementrian Kesehatan RI, œPenyakit Jantung Penyebab Utama Kematian, Kemenkes Perkuat Layanan Primer, 2022. [Online]. Available: https://www.kemkes.go.id/article/ print/22092900001/penyakit-jantung-penyebab-utama-kematian-kemenkes-perkuat-layanan-primer.html [Diakses 23 Maret 2023].

F. Maspiyanti and J. Gatc, œDiagnosa Penyakit Jantung pada Ponsel Menggunakan Pohon Keputusan, J. Teknol. Terpadu, vol. 1, no. 1, pp. 13“20, 2015.

J. J. Pangaribuan, H. Tanjaya, and Kenichi, œMendeteksi Penyakit Jantung Menggunakan Machine Learning dengan Algoritma Logistic Regression, Inf. Syst. Dev., vol. 6, no. 2, pp. 1“10, 2021.

A. Adeli and M. Neshat, œA Fuzzy Expert System for Heart Disease Diagnosis, in Proceedings of The International MultiConference of Engineers and Computer Scientists, 2010, vol. 1.

D. S. I. Fiano and A. S. Purnomo, œSistem Pakar Untuk Mendeteksi Tingkat Resiko Penyakit Jantung Dengan Fuzzy Inferensi (Mamdani), Informatics J., vol. 2, no. 2, pp. 64“78, 2017.

Murni, R. Kosasih, A. Fahrurozi, T. Handhika, I. Sari, and D. P. Lestari, œTravel Time Estimation for Destination In Bali Using kNN-Regression Method with Tensorflow, IOP Conf. Ser. Mater. Sci. Eng., vol. 854, no. 012061, pp. 1“7, 2020, doi: 10.1088/1757-899X/854/1/012061.

R. Kosasih, œClassification of Banana Ripe Level Based on Texture Features and KNN Algorithms, JNTETI, vol. 10, no. 4, pp. 383“388, 2021.

H. D. C. UCI, œHeart Disease Cleveland Database, 2020. [Online]. Available: https:// archive.ics.uci.edu/ml/datasets/heart+disease. [Diakses 24 Maret 2023].

R. Kosasih, œKombinasi Metode Isomap dan KNN Pada Image Processing Untuk Pengenalan Wajah, CESS (Journal Comput. Eng. Syst. Sci., vol. 5, no. 2, pp. 166“170, 2020.

A. Fahrurozi and R. Kosasih, œTexture Features and Statistical Features for Wood Types Classification System, in 5th International Conference of Computer and Informatics Engineering (IC2IE), 2022, pp. 186“191.

D. P. Lestari and R. Kosasih, œComparison of two deep learning methods for detecting fire hotspots, Int. J. Electr. Comput. Eng., vol. 12, no. 3, pp. 3118“3128, 2022, doi: 10.11591/ijece.v12i3.pp3118-3128.

D. P. Lestari, R. Kosasih, T. Handhika, Murni, I. Sari, and A. Fahrurozi, œFire Hotspots Detection System on CCTV Videos Using You only Look Once (YOLO) Method and Tiny YOLO Model for High Buildings Evacuation, in 2nd International Conference of Computer and Informatics Engineering IC2IE, 2019, pp. 87“92.

Downloads

Published

2023-07-01

Issue

Section

Articles