Deteksi Dini Risiko Penyakit Jantung Koroner Menggunakan Algoritma Decision Tree dan Random Forest
Abstract
Coronary heart disease is the leading cause of global mortality, accounting for 17.9 million deaths annually. Early detection is crucial in mitigating risks and preventing further complications. However, conventional diagnostic methods, such as traditional medical evaluations, often struggle to efficiently process large volumes of medical data, necessitating a more optimal approach. To enhance efficiency, this study employs machine learning to develop a classification model for coronary heart disease risk using Decision Tree and Random Forest algorithms. These models are then compared to determine the most optimal approach. The model is built using the Framingham Heart Study Dataset, consisting of 4,240 records with 15 relevant features. Due to class imbalance in the target variable, the Random Over-Sampling method is applied to improve classification performance. Model evaluation is conducted using a confusion matrix to compare the performance of both algorithms. The results indicate that Random Forest outperforms Decision Tree, achieving an accuracy of 97.64%, precision of 96.02%, recall of 99.29%, and F1-score of 97.63%. In contrast, Decision Tree yields an accuracy of 91.04%, precision of 84.76%, recall of 99.57%, and F1-score of 91.57%. This study suggests that Random Forest is more effective for early detection of coronary heart disease. Therefore, Random Forest-based models hold potential for clinical prediction systems, though further optimization is needed to enhance accuracy and reliability.
Downloads
References
F. Andika, N. Afriza, A. Husna, N. Rahmi, and F. Safitri, “Edukasi Tentang Isu Permasalahan Kesehatan Di Indonesia Bersama Calon Tenaga Kesehatan Masyarakat Provinsi Aceh,” 2022.
Institute for Health Metrics and Evaluation (IHME), “Global Burden of Disease 2021,” 2021. Accessed: Mar. 05, 2025. [Online]. Available: https://www.healthdata.org/research-analysis/library/global-burden-disease-2021-findings-gbd-2021-study
World Health Organization, “Cardiovascular diseases (CVDs).” Accessed: Jan. 19, 2025. [Online]. Available: https://www.who.int/news-room/fact-sheets/detail/cardiovascular-diseases-(cvds)
G. A. Mensah et al., “Global Burden of Cardiovascular Diseases and Risks, 1990-2022,” J Am Coll Cardiol, vol. 82, no. 25, pp. 2350–2473, Dec. 2023, doi: 10.1016/j.jacc.2023.11.007.
C. W. Tsao et al., “Heart Disease and Stroke Statistics-2022 Update: A Report from the American Heart Association,” Feb. 22, 2022, Lippincott Williams and Wilkins. doi: 10.1161/CIR.0000000000001052.
M. Di Cesare et al., “The Heart of the World,” Glob Heart, vol. 19, no. 1, 2024, doi: 10.5334/gh.1288.
International Diabetes Federation (IDF), “IDF Diabetes Atlas 10th edition.,” 2021. Accessed: Mar. 05, 2025. [Online]. Available: https://diabetesatlas.org/atlas/tenth-edition/
C. Krittanawong et al., “Deep learning for cardiovascularmedicine: A practical primer,” Jul. 01, 2019, Oxford University Press. doi: 10.1093/eurheartj/ehz056.
V. D. Nagarajan, S. L. Lee, J. L. Robertus, C. A. Nienaber, N. A. Trayanova, and S. Ernst, “Artificial intelligence in the diagnosis and management of arrhythmias,” Oct. 07, 2021, Oxford University Press. doi: 10.1093/eurheartj/ehab544.
K. Seetharam et al., “Applications of Machine Learning in Cardiology,” Sep. 01, 2022, Adis. doi: 10.1007/s40119-022-00273-7.
A. Roihan, P. Abas Sunarya, and A. S. Rafika, “Pemanfaatan Machine Learning dalam Berbagai Bidang: Review paper,” IJCIT (Indonesian Journal on Computer and Information Technology), vol. 5, no. 1, pp. 75–82, 2019.
Z. I. Attia et al., “An artificial intelligence-enabled ECG algorithm for the identification of patients with atrial fibrillation during sinus rhythm: a retrospective analysis of outcome prediction,” The Lancet, vol. 394, no. 10201, pp. 861–867, Sep. 2019, doi: 10.1016/S0140-6736(19)31721-0.
R. G. Wardhana, G. Wang, and F. Sibuea, “Penerapan Machine Learning dalam Prediksi Tingkat Kasus Penyakit Di Indonesia,” Journal of Information System Management (JOISM) e-ISSN, vol. 5, no. 1, pp. 2715–3088, 2023.
E. Retnoningsih and R. Pramudita, “Mengenal Machine Learning Dengan Teknik Supervised dan Unsupervised Learning Menggunakan Python,” BINA INSANI ICT JOURNAL, vol. 7, no. 2, pp. 156–165, 2020, [Online]. Available: https://www.python.org/
National Heart Lung and Blood Institute (NHLBI), “Framingham heart study dataset,” Kaggle. Accessed: Nov. 11, 2024. [Online]. Available: https://www.kaggle.com/datasets/aasheesh200/framingham-heart-study-dataset
A. Wulan, N. Dari, and I. N. Fajri, “Penerapan Algoritma K-Nearest Neighbor (KNN) Untuk Klasifikasi Resiko Penyakit Jantung,” Journal of Information System Research, vol. 6, no. 1, pp. 428–436, 2024, doi: 10.47065/josh.v6i1.6038.
E. S. Kresnawati, Y. Resti, B. Suprihatin, M. R. Kurniawan, and W. A. Amanda, “Coronary Artery Disease Prediction Using Decision Trees and Multinomial Naïve Bayes with k-Fold Cross Validation,” Inovasi Matematika (Inomatika), vol. 3, no. 2, pp. 172–187, 2021, doi: 10.35438/inomatika.
P. Gupta and D. Seth, “Comparative analysis and feature importance of machine learning and deep learning for heart disease prediction,” Indonesian Journal of Electrical Engineering and Computer Science, vol. 29, no. 1, pp. 451–459, Jan. 2023, doi: 10.11591/ijeecs.v29.i1.pp451-459.
Rian Oktafiani, Arief Hermawan, and Donny Avianto, “Max Depth Impact on Heart Disease Classification: Decision Tree and Random Forest,” Jurnal RESTI (Rekayasa Sistem dan Teknologi Informasi), vol. 8, no. 1, pp. 160–168, Feb. 2024, doi: 10.29207/resti.v8i1.5574.
R. J. Suhatril, R. D. Syah, M. Hermita, B. Gunawan, and W. Silfianti, “Evaluation of Machine Learning Models for Predicting Cardiovascular Disease Based on Framingham Heart Study Data,” ILKOM Jurnal Ilmiah, vol. 16, no. 1, pp. 68–75, Apr. 2024, doi: 10.33096/ilkom.v16i1.1952.68-75.
T. A. Assegie, K. K. Napa, T. Thulasi, A. K. Kumar, M. J. T. V. Priya, and V. Dhamodaran, “Scalability and performance of decision tree for cardiovascular disease prediction,” IAES International Journal of Artificial Intelligence, vol. 13, no. 3, pp. 2540–2545, Sep. 2024, doi: 10.11591/ijai.v13.i3.pp2540-2545.
I. Roshanski, M. Kalech, and L. R. Ben, “Automatic Feature Engineering for Learning Compact Decision Trees,” 2022. [Online]. Available: https://ssrn.com/abstract=4280154
Yovita, “Algoritma Machine Learning yang Harus Kamu Pelajari di Tahun 2021,” Dqlab.id. Accessed: Mar. 05, 2025. [Online]. Available: https://dqlab.id/algoritma-machine-learning-yang-perlu-dipelajari
I. Gede, I. Sudipa, and M. Darmawiguna, BUKU AJAR DATA MINING. [Online]. Available: https://www.researchgate.net/publication/377415198
I. Permana and F. Nur Salisah, “Pengaruh Normalisasi Data Terhadap Performa Hasil Klasifikasi Algoritma Backpropagation,” IJIRSE: Indonesian Journal of Informatic Research and Software Engineering, vol 2, no 1, 2022, doi: https://doi.org/10.57152/ijirse.v2i1.311
R. Ramadhan Laska and A. Mudya Yolanda, “A Comparative Study of Z-Score and Min-Max Normalization for Rainfall Classification in Pekanbaru,” Journal of Data Science, 2024, doi: 10.61453/jods.v2024no04
A. T. Akbar, R. Husaini, B. M. Akbar, and S. Saifullah, “A proposed method for handling an imbalance data in classification of blood type based on Myers-Briggs type indicator,” Jurnal Teknologi dan Sistem Komputer, vol. 8, no. 4, pp. 276–283, Oct. 2020, doi: 10.14710/jtsiskom.2020.13625.
N. Cahyana, S. Khomsah, and A. S. Aribowo, “Improving Imbalanced Dataset Classification Using Oversampling and Gradient Boosting,” in Proceeding - 2019 5th International Conference on Science in Information Technology: Embracing Industry 4.0: Towards Innovation in Cyber Physical System, ICSITech 2019, Institute of Electrical and Electronics Engineers Inc., Oct. 2019, pp. 217–222. doi: 10.1109/ICSITech46713.2019.8987499.
M. Al Khaldy, “Resampling Imbalanced Class and the Effectiveness of Feature Selection Methods for Heart Failure Dataset,” International Robotics & Automation Journal, vol. 4, no. 1, Feb. 2018, doi: 10.15406/iratj.2018.04.00090.
N. L. W. S. R. Ginantra et al., FullBook Data Mining dan Penerapan Algoritma. Yayasan Kita Menulis, 2021.
A. Afifuddin and L. Hakim, “Deteksi Penyakit Diabetes Mellitus Menggunakan Algoritma Decision Tree Model Arsitektur C4.5,” Jurnal Krisnadana, vol. 3, no. 1, Sep. 2023, Accessed: Nov. 11, 2024
S. Sza et al., “Penerapan Decision Tree dan Random Forest dalam Deteksi Tingkat Stres Manusia Berdasarkan Kondisi Tidur,” Jurnal Teknologi Informasi dan Ilmu Komputer (JTIIK), vol. 11, no. 5, pp. 1043–1050, 2024, doi: 10.25126/jtiik.2024117993.
R. Sheila, T. Rahmayani, and F. Budiman, “Analisa Optimasi Grid Search pada Algoritma Random Forest dan Decision Tree untuk Klasifikasi Stunting,” Technology and Science (BITS), vol. 6, no. 3, 2024, doi: 10.47065/bits.v6i3.6128.
N. C. Sari and T. Linda Larasati, “Komparasi Algoritma Naïve Bayes dan Gradient Boosting untuk Prediksi Pasien Diabetes,” Jurnal Nasional Teknologi dan Sistem Informasi, vol. 10, no. 2, pp. 118–125, Aug. 2024, doi: 10.25077/TEKNOSI.v10i2.2024.118-125.
Bila bermanfaat silahkan share artikel ini
Berikan Komentar Anda terhadap artikel Deteksi Dini Risiko Penyakit Jantung Koroner Menggunakan Algoritma Decision Tree dan Random Forest
Pages: 2582-2593
Copyright (c) 2025 Slamet Hudha Nurrohman, Defri Kurniawan

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under Creative Commons Attribution 4.0 International License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (Refer to The Effect of Open Access).