Heart Attack Risk Prediction Using Machine Learning: A Comparative Study of Decision Tree and K-Nearest Neighbors - Hizbullah, Fauzi; Noorachmad Muttaqin, Alif; Andiharsa Sih Setiarto, Rahardian; Aulia Hakim, Rizki; Abdulmana, Sahidan (Yayasan Asmin Intelektual Berkah, 2025)
Heart disease, particularly heart attacks, is a leading cause of death worldwide, highlighting the importance of early detection and risk prediction. This study develops and evaluates machine learning models to predict heart attack risk using seven health-related attributes: age, marital status, gender, body weight category, cholesterol level, participation in stress management training, and stress level. The dataset, processed with the Orange Data Mining platform, was divided into training (66%) and testing (34%) sets. Two supervised algorithms, Decision Tree and K-Nearest Neighbors (K-NN), were implemented without extensive hyperparameter tuning. Model performance was evaluated using accuracy, precision, recall, and F1 score. The Decision Tree achieved the best results with 84.78% accuracy, 88.52% precision, 79.41% recall, and 83.72% F1 score, indicating its effectiveness in identifying at-risk individuals. Key predictors included age, stress level, and cholesterol, aligning with established medical findings. While the results are promising, limitations include a small dataset and limited algorithm scope. Future research should expand the dataset, include additional clinical features, and explore advanced algorithms to improve accuracy and reduce false negatives, enhancing applicability in preventive healthcare.