Application of K-Nearest Neighbors Imputer (KNNI) and Random Forest Methods for Imputation and Prediction of Heart Disease

Authors

  • Amandasari Dinda Rabbani Universitas Pembangunan Nasional Veteran Jawa Timur Author
  • Deanita Nur Fauzizah Universitas Pembangunan Nasional Veteran Jawa Timur Author
  • Alfan Rizaldy Pratama Universitas Pembangunan Nasional Veteran Jawa Timur Author

Keywords:

Heart Disease, Data Imputation, KNN Imputer, Random Forest, Machine Learning

Abstract

Heart disease is one of the leading causes of death worldwide, making accurate prediction methods essential for early detection and prevention. The application of machine learning in healthcare is often challenged by the presence of missing values in clinical data, which can significantly reduce model performance. This study aims to apply the K-Nearest Neighbors Imputer (KNNI) to handle missing values and to develop a heart disease prediction model using the Random Forest algorithm. The dataset used is the Heart Disease Dataset from the UCI Machine Learning Repository, consisting of 920 patient records with 15 attributes. The research process includes initial data analysis, data preprocessing, missing value imputation using KNNI with k = 5, data splitting with an 80:20 ratio, and classification modeling using Random Forest with 100 decision trees. Model performance is evaluated using accuracy, precision, recall, F1-score, and Area Under the Curve (AUC). The results show that the proposed model achieves an accuracy of 59.78%, an F1- score of 56.22%, and an AUC of 0.852 , indicating good discriminative capability in distinguishing between high-risk and low-risk patients. Feature importance analysis reveals that clinical variables such as thalch, oldpeak, age, and ca play significant roles in the prediction process. Overall, the combination of KNN Imputer and Random Forest demonstrates promising potential as a baseline approach for medical decision support systems in heart disease prediction 

Published

2026-02-05

Similar Articles

1-10 of 15

You may also start an advanced similarity search for this article.