JOURNAL OF SCIENCE AND SOCIAL RESEARCH
Vol. 9 No. 4 (2026): August 2026 (1)

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

Herwin Simanjuntak (Institut Agama Kristen Negeri Tarutung)
Juni Santo Sihotang (Institut Agama Kristen Negeri Tarutung)
Purwa Hasan Putra (Politeknik Negeri Medan)



Article Info

Publish Date
31 Aug 2026

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.

Copyrights © 2026






Journal Info

Abbrev

JSSR

Publisher

Subject

Computer Science & IT Economics, Econometrics & Finance Education Social Sciences

Description

Journal of Science and Social Research is accepts research works from academicians in their respective expertise of studies. Journal of Science and Social Research is platform to disclose the research abilities and promote quality and excellence of young researchers and experienced thoughts towards ...