Class imbalance in heart disease datasets poses a critical challenge in machine learning applications, as models often become biased toward the majority class. This imbalance reduces accuracy and limits the model’s ability to identify minority cases, which are highly important in medical diagnosis. This study investigates the effectiveness of oversampling techniques, namely Random Oversampling and Synthetic Minority Over-sampling Technique (SMOTE), in enhancing the performance of three classification algorithms: K-Nearest Neighbors (KNN), Naive Bayes (NB), and Random Forest (RF). The dataset, obtained from Kaggle, consists of 918 records with 12 attributes representing patient health indicators related to heart disease prediction. The research process involved data preprocessing, baseline classification experiments, and re-experiments using the oversampling methods. The results show that all three algorithms benefited from oversampling, though the degree of improvement varied. KNN achieved its best performance with SMOTE, reaching 72.98% accuracy and an F1-score of 75.39%. Naive Bayes produced relatively stable results across both methods, with SMOTE slightly outperforming Random Oversampling, achieving the best F1-score of 73.56%. Random Forest demonstrated the highest overall performance when combined with Random Oversampling, recording 79.19% accuracy and an F1-score of 81.51%, surpassing both the baseline and SMOTE. These findings confirm that oversampling techniques can effectively improve classification performance but their impact depends on the characteristics of each algorithm. The novelty of this study lies in analyzing the interaction between oversampling strategies and classification models, offering practical guidance for selecting appropriate data balancing approaches in medical classification tasks
Copyrights © 2026