Publishing Journal • Journal of Science and Social Research (JSSR)

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

DOI: 10.54314/jssr.v9i4.7214 Published: 24 July 2026 Pages: 31-45 (Vol. 9, No. 4) Views: 1
Authors & Researchers
S
Simanjuntak, Herwin Institut Agama Kristen Negeri Tarutung1
S
Sihotang, Juni Santo Institut Agama Kristen Negeri Tarutung2
P
Putra, Purwa Hasan Politeknik Negeri Medan3

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.

Indexing Journal

Journal of Science and Social Research (JSSR) Cover

Journal of Science and Social Research (JSSR)

ISSN: 2615 –4307 Publisher: GORETAN PENA