ANALISIS DAN OPTIMASI PREDIKSI RISIKO PENYAKIT JANTUNG MENGGUNAKAN RANDOM FOREST DAN XGBOOST BERBASIS FEATURE SELECTION

Authors

  • Herwin Simanjuntak Institut Agama Kristen Negeri Tarutung, Indonesia Author
  • Juni Santo Sihotang Institut Agama Kristen Negeri Tarutung, Indonesia Author
  • Purwa Hasan Putra Politeknik Negeri Medan, Indonesia Author

DOI:

https://doi.org/10.54314/jssr.v9i4.7214

Keywords:

Heart Disease, Random Forest, XGBoost, Feature Selection, Hyperparameter Tuning

Abstract

Abstract: This study aims to analyze and optimize heart disease risk prediction using Random Forest and XGBoost algorithms combined with feature selection. The dataset used is the Cleveland Heart Disease Dataset, comprising 303 patient records, 13 predictor features, and a target variable converted into a binary classification. The research stages include preprocessing, data splitting using a stratified train-test split, feature selection, hyperparameter tuning, and evaluation based on accuracy, precision, recall, F1-score, and ROC-AUC. Feature selection yielded eight selected features—thal, cp, thalach, ca, oldpeak, exang, chol, and slope—resulting in a 38.46% reduction in the total number of features. Test results indicate that the Optimized Random Forest model combined with feature selection achieved the best performance, with an accuracy of 91.80%, precision of 89.66%, recall of 92.86%, F1-score of 91.23%, and ROC-AUC of 95.67%.

Keywords: Heart Disease, Random Forest, XGBoost, Feature Selection, Hyperparameter Tuning.

 

Abstrak: Penelitian ini bertujuan menganalisis dan mengoptimalkan prediksi risiko penyakit jantung menggunakan algoritma Random Forest dan XGBoost berbasis feature selection. Dataset yang digunakan adalah Cleveland Heart Disease Dataset yang terdiri atas 303 data pasien, 13 fitur prediktor, dan satu target yang dikonversi menjadi klasifikasi biner. Tahapan penelitian meliputi preprocessing, pembagian data menggunakan stratified train-test split, feature selection, hyperparameter tuning, serta evaluasi menggunakan accuracy, precision, recall, F1-score, dan ROC-AUC. Feature selection menghasilkan 8 fitur terpilih, yaitu thal, cp, thalach, ca, oldpeak, exang, chol, dan slope, sehingga jumlah fitur berkurang sebesar 38,46%. Hasil pengujian menunjukkan bahwa Optimized Random Forest + Feature Selection memberikan performa terbaik dengan accuracy 91,80%, precision 89,66%, recall 92,86%, F1-score 91,23%, dan ROC-AUC 95,67%.

Kata Kunci: Penyakit Jantung, Random Forest, XGBoost, Feature Selection, Hyperparameter Tuning.

Downloads

Download data is not yet available.

References

C. Z. Syahputri, S. Informasi, I. Komputer, and U. D. Jambi, “Optimasi XGBoost Dengan SHAP Untuk Sistem Skrining Penyakit Jantung,” no. November, 2025.

J. Elektronika, I. Terapan, S. K. Parinduri, and A. Pribadi, “Prediksi Risiko Penyakit Jantung Menggunakan Xgboost dengan Optimasi Hyperparameter Berbasis GridsearchCV Penyakit Jantung dan Machine Learning,” vol. 4, no. 1, 2026.

Y. Optarina et al., “Jurnal Software Engineering and Information System ( SEIS ) OPTIMASI MODEL XGBOOST UNTUK PREDIKSI PENYAKIT JANTUNG,” vol. 6, no. 1, 2026.

D. A. N. K. N. Dalam, “ANALISIS PERBANDINGAN PERFORMA ALGORITMA RANDOM,” vol. 5, no. 3, pp. 302–311, 2026.

A. E. Pranajaya and E. R. Susanto, “Optimasi Random Forest untuk Prediksi Penyakit Jantung Menggunakan SMOTEENN dan Grid Search Sistem Informasi , Fakultas Teknik dan Ilmu Komputer , Universitas Teknokrat Indonesia , Indonesia Random Forest Optimization for Heart Disease Prediction Using SMOTEENN and Grid Search,” vol. 5, no. 7, pp. 1965–1979, 2025.

I. Husni, A. Amin, S. Wibisono, and E. Lestariningsih, “Optimizing Heart Disease Prediction with Random Forest and Ensemble Methods,” vol. 11, no. 1, pp. 80–90, 2025.

A. Pratama, S. Assegaff, J. Jasmir, and N. Nurhadi, “Optimizing Heart Disease Classification Using C4 . 5 , Random Forest , and XGBoost with ANOVA , Chi-Square , and AdaBoost,” vol. 7, no. 2, pp. 1072–1090, 2026.

M. N. Fadhlurrahman, “Optimization of Heart Failure Risk Prediction Using Random Forest Classifier Algorithm,” pp. 57–64, 2025.

N. L. Wicaksono, “Optimasi Hyperparameter Ensemble Learning untuk Prediksi Penyakit Jantung berdasarkan Data Pasien Hyperparameter Optimization of Ensemble Learning for Heart Disease Prediction using Patient Data,” vol. 15, pp. 896–906, 2026.

M. T. P. Mukti, H. Hairani, D. Rahardjo, and M. Rizki, “A Comparison of Logistic Regression , Random Forest , and XGBoost Based on Feature Importance in Heart Failure Prediction,” vol. 5, no. 2, pp. 61–72

M. Dzaky and A. P. Kuncoro, “Optimizing XGBoost for Heart Disease Risk Classification Using Optuna and Random Search on the Behavioral Risk Factor Surveillance System ( BRFSS ) 2023 Dataset,” vol. 10, no. 1, 2026.

S. Ahmed, N. Elazab, M. M. El-gayar, M. Elmogy, and Y. M. Fouda, “Multi-Scale Vision Transformer with Optimized Feature Fusion for Mammographic Breast Cancer Classification,” pp. 1–30, 2025.

M. S. Lydia et al., “Mid-Upper Arm Circumference Measurement Using Digital Images : A Top-Down Approach with Panoptic Segmentation Using Mask R-CNN,” vol. 16, no. 8, pp. 392–404, 2025.

P. H. Hutagalung, S. Informasi, and U. Nasional, “Heart Disease Classification Using Optimised XGBoost and Random Forest with SHAP Explanations,” vol. 10, no. 1, pp. 330–342, 2026.

A. R. Lubis, P. H. Putra, and F. S. Lubis, “Optimization of principal component analysis and k-nearest neighbors in cultivation area classification red onion,” vol. 23, no. 6, pp. 1579–1589, 2025.

P. H. Putra, D. Selvida, and M. S. Novelan, “Application of Apriori Algorithm in Data Mining to Find Consumer Purchasing Patterns in Supermarkets,” vol. 4, no. 1, pp. 221–226, 2025.

D. Selvida, P. Hasan, and M. Mughnyanti, “Penerapan Algoritma Apriori dan K- Nearest Neighbor Untuk Analisis Pola Prediksi Pembelian,” vol. 4, no. 1, pp. 54–63, 2026.

Downloads

Published

2026-08-31

How to Cite

ANALISIS DAN OPTIMASI PREDIKSI RISIKO PENYAKIT JANTUNG MENGGUNAKAN RANDOM FOREST DAN XGBOOST BERBASIS FEATURE SELECTION. (2026). JOURNAL OF SCIENCE AND SOCIAL RESEARCH, 9(4), 7385-7392. https://doi.org/10.54314/jssr.v9i4.7214