Analisis Kinerja Random Forest dan XGBoost serta Ensemble Soft Voting untuk Klasifikasi Stroke pada Dataset yang Tidak Seimbang
Abstract
Stroke is one of the leading causes of disability and death worldwide, highlighting the need for predictive methods that can support early stroke risk detection. This study aims to implement an Ensemble Soft Voting method based on the combination of Random Forest and XGBoost algorithms and compare its performance with individual models for stroke classification using the Framingham Heart Study dataset, which exhibits a high degree of class imbalance. The initial dataset consisted of 11.627 records with 39 attributes and underwent several preprocessing stages, including attribute selection based on medical literature, data deduplication, handling of missing value using MICE, outlier treatment, feature selection using ANOVA F-Test, and data balancing using SMOTE-ENN. Model validation was performed using Stratified K-Fold Cross Validation with k values ranging from 3 to 20, while hyperparameter optimization was conducted using GridSearchCV. The results showed that Random Forest achieved the best performance in terms of F1-Score and Recall, with values of 36.52% and 67.74%, respectively, using a 90:10 train-test split and k=5. Meanwhile, XGBoost achieved the highest Accuracy and Precision of 82.98% and 25.71%, respectively, whereas Ensemble Soft Voting obtained the highest ROC-AUC value of 81.29%. PCA and t-SNE visualizations revealed a considerable degree of overlap between the Stroke and No Stroke classes, making the classification task more challenging. The findings indicate that Random Forest provides the best balance in identifying stroke cases within the dataset, although data characteristics remain a major factor influencing classification performance.
Downloads
References
H. Muftisany, T. F. Efendi, N. Akbar, and R. Rais, “Perbandingan Kinerja Algoritma Random Forest , AdaBoost , dan Gradient Boosting dalam Memprediksi Risiko Penyakit Hipertensi,” J. Fakt. Exacta, vol. 18, no. 2, pp. 161–171, 2025.
S. A. S. Mola, Y. C. Luttu, and D. N. Rumlaklak, “Perbandingan Metode Machine Learning dalam Analisis Sentimen Komentar Pengguna Aplikasi InDriver pada Dataset Tidak Seimbang,” J. Sist. Inf. Bisnis, vol. 14, no. 3, pp. 247–255, 2024, doi: 10.21456/vol14iss3pp247-255.
R. Faizal, A. Abdullah, and M. W. Pangestika, “Perbandingan Random Forest Regressor Dan Decision Tree Regressor Untuk Prediksi Hasil Panen,” J. CoSciTech (Computer Sci. Inf. Technol., vol. 6, no. 2, pp. 247–253, 2025.
T. P. Djaka, N. Anisa, and S. Winarsih, “Analisis Kinerja Ensemble Learning dan Algoritma Tunggal dalam Klasifikasi Sindrom Ovarium Polikistik Menggunakan Random Forest , Logistic Regression , dan XGBoost,” J. Infotekmesin, vol. 16, no. 01, pp. 43–51, 2025, doi: 10.35970/infotekmesin.v16i1.2504.
Z. Zuriati and N. Qomariyah, “Klasifikasi Penyakit Stroke Menggunakan Algoritma K-Nearest Neighbor (KNN),” ROUTERS J. Sist. dan Teknol. Inf., vol. 1, no. 1, pp. 1–8, Nov. 2022, doi: 10.25181/RT.V1I1.2665.
S. Rahayu and Y. Yamasari, “Klasifikasi Penyakit Stroke dengan Metode Support Vector Machine (SVM),” J. Informatics Comput. Sci., vol. 5, no. 03, pp. 440–446, Feb. 2024, doi: 10.26740/jinacs.v5n03.p440-446.
A. Fitri, I. Afrianty, E. Budianita, and S. K. Gusti, “Implementation of Feature Selection Information Gain in Support Vector Machine Method for Stroke Disease Classification,” Bull. Informatics Data Sci., vol. 4, no. 1, pp. 22–33, May 2025, doi: 10.61944/bids.v4i1.116.
K. Sari et al., “Deteksi Dini Stroke Menggunakan Machine Learning,” INSOLOGI J. Sains dan Teknol., vol. 4, no. 4, pp. 706–720, Aug. 2025, doi: 10.55123/INSOLOGI.V4I4.5590.
K. Wirastuti, N. Sofi, and I. Rosdiana, “Pendampingan Kader Kesehatan dengan Intervensi Penyuluhan Peduli Cegah Kenali dan Atasi Stroke (Cekatan Stroke) Kelurahan Banjardowo Kecamatan Genuk Kota Semarang,” J. ABDIMAS-KU J. Pengabdi. Masy. Kedokt., vol. 3, no. 1, pp. 6–12, Jan. 2024, doi: 10.30659/abdimasku.3.1.6-12.
I. Bagus, A. Indra Iswara, G. Anandita, and M. Dahul, “Comparative Analysis of Naïve Bayes and K-Nearest Neighbor (KNN) Algorithms in Stroke Classification,” J. Comput. Networks, Archit. High Perform. Comput., vol. 6, no. 3, pp. 1415–1424, Jul. 2024, doi: 10.47709/CNAHPC.V6I3.4395.
C. D. Usman, A. P. Widodo, K. Adi, and R. Gernowo, “Rainfall prediction model in Semarang City using machine learning,” Indones. J. Electr. Eng. Comput. Sci., vol. 30, no. 2, pp. 1224–1231, 2023, doi: 10.11591/ijeecs.v30.i2.pp1224-1231.
C. Arafat et al., “Perbandingan Algoritma Random Forest Dan Xgboost Untuk Klasifikasi Penyakit Jantung Berdasarkan Data Medis,” J. Fasilcom, vol. 15, no. 2, pp. 430–435, 2025.
Pahrul, “Skripsi perbandingan metode klasifikasi random forest, xgboost dan svm pada analisis sentimen aplikasi kredit dan pinjaman online,” J. Ilk. Hasanuddin, vol. 3, no. 2, pp. 60–69, 2023.
K. Wirastuti, N. S. Riasari, D. Djannah, and M. Silviana, “Upaya Pencegahan Stroke melalui Skrining Skor Risiko Stroke dengan Intervensi Penyuluhan dan Pemeriksaan Faktor Risiko Stroke di Kelurahan Bojong Salaman Kecamatan Pusponjolo Selatan Semarang Barat,” J. ABDIMAS-KU J. Pengabdi. Masy. Kedokt., vol. 2, no. 1, pp. 23–29, Jan. 2023, doi: 10.30659/abdimasku.2.1.23-29.
M. S. Islam et al., “Explainable deep learning for rainfall prediction: A CNN-XGBoost hybrid approach in the northern region of Bangladesh,” Neural Comput. Appl., vol. 37, no. 33, pp. 28125–28160, 2025, doi: 10.1007/s00521-025-11646-z.
S. A. Zebua, “Modifikasi Algoritma Vigenere Cipher dengan Pembangkit Kunci Random Number Generator Dalam Pengamanan Citra Digital,” J. Comput. Informatics Res., vol. 1, no. 3, pp. 71–81, 2022.
T. H. Raza, A. Ahmad, M. Z. Hussain, M. Z. Hasan, H. R. Basra, and A. Bilal, “Enhancing Multivariate Data Classification Using Graph Convolutional Networks: A Comparative Evaluation with PCA and t-SNE,” VAWKUM Trans. Comput. Sci., vol. 13, no. 2, pp. 149–165, Oct. 2025, doi: 10.21015/VTCS.V13I2.2052.
A. Y. Barrera-Animas, L. O. Oyedele, M. Bilal, T. D. Akinosho, J. M. D. Delgado, and L. A. Akanbi, “Rainfall prediction: A comparative analysis of modern machine learning algorithms for time-series forecasting,” Mach. Learn. with Appl., vol. 7, no. August 2021, p. 100204, 2022, doi: 10.1016/j.mlwa.2021.100204.
M. Alvines et al., “Komparasi Ridge Regression, Random Forest, Dan Gradient Boosting Untuk Prediksi Curah Hujan Harian Di Sumatra Selatan Berbasis Time Series Cross-Validation,” JATI (Jurnal Mhs. Tek. Inform., vol. 9, no. 4, pp. 5742–5748, 2025, doi: 10.36040/jati.v9i4.13915.
I. Kurniawan, D. C. P. Buani, A. Abdussomad, W. Apriliah, and R. A. Saputra, “Implementasi algoritma random forest untuk menentukan penerima bantuan raskin,” J. Teknol. Inf. Dan Ilmu Komput., vol. 10, no. 2, pp. 421–428, 2023.
Bila bermanfaat silahkan share artikel ini
Berikan Komentar Anda terhadap artikel Analisis Kinerja Random Forest dan XGBoost serta Ensemble Soft Voting untuk Klasifikasi Stroke pada Dataset yang Tidak Seimbang
Pages: 244-258
Copyright (c) 2026 Bagus Fadhil Husain, Siska Kurnia Gusti, Muhammad Fikry, Reski Mai Candra

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under Creative Commons Attribution 4.0 International License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (Refer to The Effect of Open Access).


