Heart Failure Disease Classification Using Random Forest Algorithm with Grid Search Cross Validation Technique

Authors

  • Rapindra Septia Universitas Sains dan Teknologi Indonesia
  • Junadhi Universitas Sains dan Teknologi Indonesia
  • Susi Erlinda Universitas Sains dan Teknologi Indonesia
  • Wirta Agustin Universitas Sains dan Teknologi Indonesia

DOI:

https://doi.org/10.33022/ijcs.v14i2.4765

Keywords:

: hyperparameter tunning, logistic regression, random forest, decision tree, gradient boost tree

Abstract

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

30-04-2025