Heart failure is a cardiovascular disease with a high mortality rate, requiring a prediction system capable of assisting in faster and more accurate early detection. This study aims to compare the performance of Logistic Regression, Random Forest, and XGBoost in predicting heart failure, with a focus on feature importance. The dataset is a public Kaggle dataset, consisting of 918 patient records with 11 features and 1 target attribute. The research stages include exploratory data analysis (EDA), data preprocessing, anomaly handling, label encoding, data standardization, model training, model evaluation, and feature importance analysis. Model evaluation was conducted using accuracy, precision, recall, and F1-score. The results indicate that Random Forest achieved the best performance, with an accuracy of 86.96%, a precision and recall of 88.24%, and an F1-score of 88.24%. Meanwhile, XGBoost achieved an accuracy of 85.87%, and Logistic Regression achieved 84.78%. The feature importance analysis revealed that the ST_Slope attribute was the most dominant feature across all three models in predicting heart failure. This study demonstrates that the Random Forest method provides superior classification performance compared to the other models, and feature importance analysis can aid in interpreting the clinical attributes that influence heart failure prediction.
Copyrights © 2026