Early Detection of Cardiovascular Disease Risk Using the K-Nearest Neighbors Algorithm

Authors

  • Leo Fernandy Universitas Pelita Harapan
  • Leonardo Leonardo Universitas Pelita Harapan
  • Stanley Lim Universitas Pelita Harapan
  • Vincent Liawis Universitas Pelita Harapan
  • Ade Maulana Universitas Pelita Harapan

DOI:

https://doi.org/10.55123/jomlai.v5i2.5430

Keywords:

Cardiovascular, KNN, K-Nearest Neighbors, Prediction, Machine Learning, Model Evaluation

Abstract

Health is a fundamental aspect in determining the quality of human life. Along with changes in lifestyle and environmental conditions, various new challenges have emerged in the healthcare sector. Technological advancements, particularly in artificial intelligence, have opened significant opportunities for the development of more accurate and efficient healthcare systems. One of the most rapidly growing applications of AI is machine learning for disease prediction. This study aims to develop a model for predicting the risk of cardiovascular disease using the K-Nearest Neighbors (KNN) algorithm. The “Cardiovascular Disease” dataset from Kaggle, consisting of 68,205 entries and 17 medical attributes, was used as the basis. The research stages included data preprocessing (cleaning, categorical transformation, and normalization), selection of key features, model training, and performance evaluation. The dataset was split into 80% training data and 20% testing data. The experiment showed that k = 41 achieved the highest accuracy of 73%. Evaluation using precision, recall, and f1-score indicated fairly good performance, particularly in identifying high-risk patients. This model has the potential to serve as a decision-support tool for early detection of cardiovascular disease, enabling more accurate and preventive medical actions..

References

[1] B. Prabowo, A. Albar, and R. Salim, “Optimalisasi Kesadaran Kesehatan Warga Desa Sarirogo dengan Sosialisasi Hidup Sehat dan Implementasi Medical Check-up,”, Fundamentum: Jurnal Pengabdian Multidisiplin, Vol. 2, No. 3, PP. 70–77, Agustus 2024.

[2] R. H. Cahya, A. M. Riadhino, N. R. Adityama and T. L. M. Suryanto, “Sinergi AI Dan Machine Learning Untuk Prediksi Multikeluhan Pada Diagnosis Penyakit Kepala,”, JATI: Jurnal Mahasiswa Teknik Informatika, Vol. 9, No. 1, PP. 1469–1476, Februari 2025.

[3] Raspiyahni and Susilawati, “Penerapan Teknologi AI Untuk Meningkatkan Kesehatan Dan Keselamatan Kerja Di Industri Manufaktur,”, GJMI: Gudang Jurnal Multidisiplin Ilmu, Vol. 2, No. 6, PP. 651–655, Juni 2024.

[4] M. Martiningsih and A. Haris, “Risiko Penyakit Kardiovaskuler Pada Peserta Program Pengelolaan Penyakit Kronis (Prolanis) Di Puskesmas Kota Bima: Korelasinya Dengan Ankle Brachial Index Dan Obesitas,”, Jurnal Keperawatan Indonesia, Vol. 22, No. 3, PP. 200–208, September 2019.

[5] D. N. Hafila, Wisudawan, S. Darma, Nurhikmah and Dahlia, “Prevalensi Penyakit Kardiovaskular pada Masa Pandemic Tahun 2020-2021 di RS Arifin Nu’mang Kabupaten Sidrap,”, FAKUMI: Jurnal Mahasiswa Kedokteran, Vol. 3, No. 10, PP. 17–28, Oktober 2023.

[6] World Health Organization, “Cardiovascular diseases (CVDs),”, World Health Organization: WHO, 11 Juni 2021, [Online]. Tersedia: https://www.who.int/news-room/fact-sheets/detail/cardiovascular-diseases-(cvds) [Diakses: 13 April 2025].

[7] J. Pane, L. Simorangkir, and P. Saragih, “Faktor-Faktor Risiko Penyakit Kardiovaskular Berbasis Masyarakat,”, JPPP: Jurnal Penelitian Perawat Profesional, Vol. 4, No. 4, PP. 1183–1192, September 2022.

[8] A. F. Umara, “Deteksi Dini Penyakit Jantung dan Pembuluh Darah Pegawai,”, Media Karya Kesehatan, Vol. 3, No. 2, PP. 122–133, November 2020.

[9] I. Akbar, F. Supriadi, and D. I. Junaedi, “Pemanfaatan Machine Learning Di Bidang Kesehatan,”, JATI: Jurnal Mahasiswa Teknik Informatika, Vol. 9, No. 1, PP. 1744–1749, Februari 2025.

[10] S. Dharmawan, V. Fernandes, and H. Halim, “Prediksi Serangan Jantung Dengan Menggunakan Metode Logistic Regression Classifier Dan Adaboost,”, Computatio: Journal of Computer Science and Information Systems, Vol. 10, No. 3, PP. 96–103, Januari 2024.

[11] I. K. A. Jayaditya and I. G. A. G. Kadyanan, “Implementasi Random Forest pada Klasifikasi Penyakit Kardiovaskular dengan Hyperparameter Tuning Grid Search,”, Jurnal Nasional Teknologi Informasi dan Aplikasinya, Vol. 2, No. 1, PP. 219–226, November 2023.

[12] V. Artanti, M. Faisal, and F. Kurniawan, “Klasifikasi Cardiovascular Diseases Menggunakan Algoritma K-Nearest Neighbors (KNN),”, Techno.COM, Vol. 23, No. 2, PP. 467–479, Mei 2024.

[13] Aidan, “Cardiovascular Disease,”, Kaggle, 2023, [Online]. Tersedia: https://www.kaggle.com/datasets/colewelkins/cardiovascular-disease/data [Diakses: 13 April 2025].

[14] J. Han, M. Kamber, and J. Pei, Data Mining: Concepts and Techniques, Edisi 3. United Kingdom: Elsevier Science, 2011.

[15] S. Sathyanarayanan and B. R. Tantri, “Confusion Matrix-Based Performance Evaluation Metrics,”, AJBR: African Journal of Biomedical Research, Vol. 27, No. 4s, PP. 4023–4031, November 2024.

[16] J. L. Rodgers, J. Jones, and S. I. Bolledu, “Cardiovascular Risks Associated with Gender and Aging,”, Journal of Cardiovascular Development and Disease, Vol. 6, No. 2, PP. 1–18, April 2019.

[17] M. Vaduganathan, G. Mensah, and J. V. Turco, “The Global Burden of Cardiovascular Diseases and Risk: A Compass for Future Health,”, JACC: Journals of the American College of Cardiology, Vol. 80, No. 25, PP. 2361–2371, December 2022.

Downloads

Published

2026-06-15

How to Cite

Leo Fernandy, Leonardo, L., Lim, S., Liawis, V., & Ade Maulana. (2026). Early Detection of Cardiovascular Disease Risk Using the K-Nearest Neighbors Algorithm. JOMLAI: Journal of Machine Learning and Artificial Intelligence, 5(2), 57–64. https://doi.org/10.55123/jomlai.v5i2.5430

Issue

Section

Articles