COMPARATIVE ANALYSIS OF DECISION TREE AND k-NN (k-NEAREST NEIGHBOR) ALGORITHMS WITH BAGGING OPTIMIZATION FOR HEART DISEASE CLASSIFICATION
ANALISIS PERBANDINGAN ALGORITMA DECISION TREE DAN k-NN (k-NEAREST NEIGHNBOR) DENGAN OPTIMASI BAGGING UNTUK KLASIFIKASI PENYAKIT JANTUNG
Kata Kunci:
Heart disease, Algoritma Decision tree, Algoritma k-Nearest Neighbor, Bagging, klasifikasiAbstrak
Heart disease is one of the leading causes of death in the world, so an accurate method is needed to detect and classify this disease early. This study aims to compare the performance of the Decision tree Algorithm and k-Nearest Neighbor (k-NN) in the classification of heart disease with the application of Bagging optimization. The evaluation was carried out by measuring accuracy, error, Precision, and recall to determine the most effective algorithm. The results showed that Decision tree with Bagging had the highest accuracy of 97.82%, while k-NN only reached 93.78%. In terms of error rate, Decision tree had a lower error rate (2.18%) compared to k-NN (6.22%). In addition, the Precision and recall in Decision tree were 96.94% and 99.15%, respectively, higher than k-NN which reached 95.60% and 92.88%. With these results, it can be concluded that Decision tree with Bagging optimization is superior to k-NN in the classification of heart disease. Bagging optimization has proven effective in increasing model accuracy and reducing the level of prediction errors. The results of this study are expected to be a reference in the development of an artificial intelligence-based medical decision support system for more accurate and efficient heart disease diagnosis.
Penyakit jantung merupakan salah satu penyebab utama kematian di dunia, sehingga diperlukan metode yang akurat untuk mendeteksi dan mengklasifikasikan penyakit ini secara dini. Penelitian ini bertujuan untuk membandingkan performa Algoritma Decision tree dan k-Nearest Neighbor (k-NN) dalam klasifikasi penyakit jantung dengan penerapan optimasi Bagging. Evaluasi dilakukan dengan mengukur accuracy, error, Precision, dan recall untuk menentukan algoritma yang paling efektif. Hasil penelitian menunjukkan bahwa Decision tree dengan Bagging memiliki akurasi tertinggi sebesar 97,82%, sementara k-NN hanya mencapai 93,78%. Dari segi error rate, Decision tree memiliki tingkat kesalahan lebih rendah (2,18%) dibandingkan k-NN (6,22%). Selain itu, Precision dan recall pada Decision tree masing-masing sebesar 96,94% dan 99,15%, lebih tinggi dibandingkan k-NN yang mencapai 95,60% dan 92,88%. Dengan hasil tersebut, dapat disimpulkan bahwa Decision tree dengan optimasi Bagging lebih unggul dibandingkan k-NN dalam klasifikasi penyakit jantung. Optimasi Bagging terbukti efektif dalam meningkatkan akurasi model serta mengurangi tingkat kesalahan prediksi. Hasil penelitian ini diharapkan dapat menjadi referensi dalam pengembangan sistem pendukung keputusan medis berbasis kecerdasan buatan untuk diagnosis penyakit jantung yang lebih akurat dan efisien.