Hyperparameter Optimization of Random Forest using Grey Wolf Optimization for Heart Disease Classification: Optimasi Hiperparameter Random Forest Menggunakan Grey Wolf Optimization untuk Klasifikasi Penyakit Jantung - Ratih Khotimahtus Sa'diyah; Muhammad Sam’an; Safuan; Mustafa Mat Deris (Department of Sains Data UNIMUS Universitas Muhammadiyah Semarang, 2026)
Cardiovascular disease remains one of the leading causes of death worldwide, making predictive models important to support early heart disease detection. Random Forest is widely used for heart disease classification, but its performance can be affected by hyperparameter selection. This study focuses on applying Grey Wolf Optimization (GWO) to selected Random Forest hyperparameters and evaluating the optimized model through a direct comparison with a baseline Random Forest model on the same testing dataset, supported by statistical verification. The dataset used is the Cleveland Heart Disease Dataset, consisting of 303 patient records, 13 predictor attributes, and one target attribute. The research stages include data preparation, preprocessing, stratified data splitting with an 80:20 ratio, hyperparameter optimization using GWO, and model evaluation. The GWO process uses the average F1-score from 5-fold cross-validation on the training set as the fitness value. Model performance is evaluated using accuracy, precision, recall, F1-score, AUC-ROC, confusion matrix analysis, and the exact McNemar test. The results show that the GWO-RF model obtains higher descriptive evaluation values than the baseline RF model, with accuracy increasing from 88.52% to 93.44%, precision from 81.82% to 90.00%, F1-score from 88.52% to 93.10%, and AUC-ROC from 95.13% to 96.86%, while recall remains at 96.43%. However, the exact McNemar test produces a p-value of 0.25, indicating that the difference is not statistically significant. Therefore, the improvement is interpreted as a descriptive performance gain rather than a statistically significant improvement.