Heart Failure Disease Classification Using Random Forest Algorithm with Grid Search Cross Validation Technique
DOI:
https://doi.org/10.33022/ijcs.v14i2.4765Keywords:
: hyperparameter tunning, logistic regression, random forest, decision tree, gradient boost treeAbstract
Heart failure is one of the leading causes of death worldwide and requires early detection to reduce the risk of serious complications. However, the imbalance in medical data poses a challenge in developing accurate prediction models. This study developed a heart failure classification model using the Random Forest algorithm, optimized with Grid Search Cross Validation to find the best combination of hyperparameters. The dataset consisted of 300 observations with 12 medical features and 1 target feature. Data preprocessing included outlier removal using the Interquartile Range (IQR) and Winsorize methods. The Synthetic Minority Oversampling Technique (SMOTE) was applied to address class imbalance, resulting in a more balanced training data distribution. The dataset was split into 80% training and 20% testing data using stratified sampling to maintain class proportions. The model was evaluated using accuracy, precision, recall, and F1-score metrics, with results showing 90% accuracy, 0.94 precision for class 0, 0.80 precision for class 1, 0.91 recall for class 0, and 0.86 recall for class 1. The model was implemented in a Streamlit-based application, allowing users to input health parameters and receive interactive predictions. This study demonstrates that optimizing the Random Forest algorithm with Grid Search Cross Validation can improve heart failure classification performance, providing a practical solution for supporting heart failure classification.
Keywords: Heart Failure Classification, Random Forest, Hyperparameter Optimization, SMOTE, Model Evaluation.
Downloads
Published
Issue
Section
License
Copyright (c) 2025 Rapindra Septia, Junadhi, Susi Erlinda, Wirta Agustin

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.