Nasution, Julia Namira
Unknown Affiliation

Published : 1 Documents Claim Missing Document
Claim Missing Document
Check
Articles

Found 1 Documents
Search
Journal : Hanif Journal of Information Systems

Comparison of Logistic Regression and K-Nearest Neighbor (KNN) Algorithms in a Heart Failure Prediction Dataset Nasution, Julia Namira; Azis, Zainal
Hanif Journal of Information Systems Vol. 3 No. 1 (2025): August Edition
Publisher : Ilmu Bersama Center

Show Abstract | Download Original | Original Source | Check in Google Scholar | DOI: 10.56211/hanif.v3i1.53

Abstract

Heart failure is one of the leading causes of death worldwide. Early detection of heart failure risk is crucial to minimize its serious consequences. This study aims to compare the performance of two machine learning algorithms, namely Logistic Regression and K-Nearest Neighbor (KNN), in predicting heart failure using a dataset from the Kaggle platform. The research stages include data preprocessing, normalization, splitting into training and testing data, model implementation, and evaluation using a confusion matrix. Evaluation is based on accuracy, precision, recall, and F1-score metrics. The results show that Logistic Regression achieved an accuracy of 88.04% with an execution time of 0.022 seconds, while KNN achieved an accuracy of 85.51% with an execution time of 0.158 seconds. Logistic Regression outperformed in recall and F1-score, making it more effective for early detection of heart failure. Therefore, Logistic Regression is considered more optimal than KNN in the context of this study. However, Logistic Regression is not always superior to K-Nearest Neighbor, as prediction results highly depend on the characteristics of the specific case.