PERBANDINGAN ALGORITMA RANDOM FOREST DAN SUPPORT VECTOR MACHINES DALAM MEMPREDIKSI TINGKAT RISIKO SERANGAN JANTUNG BERDASARKAN KEBIASAAN MEROKOK - Harmaja, Okta Jaya; Fernando, Fernando; Melati, Melati (Jurnal Teknik Informasi dan Komputer (Tekinkom), 2025)
Heart disease remains a major global health challenge, with smoking behavior identified as one of the most significant modifiable risk factors. This study aims to compare the performance of two machine learning algorithms—Random Forest and Support Vector Machine (SVM)—in predicting heart attack risk levels based on smoking habits and biometric indicators. Using a dataset of 3,901 subjects obtained from Kaggle, data preprocessing and feature engineering were conducted to optimize model accuracy. The SVM algorithm achieved an accuracy of 92.43%, with its best performance observed in the medium-risk category (precision: 0.95, recall: 0.97, F1-score: 0.96), although performance declined in low and high-risk categories. In contrast, the Random Forest algorithm demonstrated superior results, reaching 99.91% accuracy with perfect precision, recall, and F1-scores (1.00) across all risk categories. The findings indicate that Random Forest not only provides more consistent and accurate predictions but also minimizes classification errors effectively. This research suggests that Random Forest is a more reliable and robust approach than SVM for integrating into intelligent health information systems to support early detection and prevention strategies for heart disease, especially among individuals with active smoking behavior.