Heart disease is one of the leading causes of death in Indonesia. In addition to coronary heart disease, smoking is the leading contributor to the death rate in Indonesia. This study aims to analyze the risk of death with the main variables of heart disease history and smoking history. This study classifies the risk of death of heart disease sufferers and smokers using the KNearest Neighbors (KNN) algorithm. The results showed that the KNN model had an accuracy of 52.38% in predicting the risk of death of smokers and heart disease patients. Confusion matrix analysis revealed that the model performed well in predicting classes 0 and 2, but had difficulty in predicting class 1. This study shows that KNN can be used to predict the risk of death of smokers and patients with heart disease with a satisfactory success rate.
Copyrights © 2024