Heart failure (HF) is the terminal stage of all heart disease and the leading cause of mortality. A reliable prognostic model for predicting mortality in patients with HF can help to support better decisions in clinical practice. Many attempts have been made to increase the reliability of the prognostic model using electronic health record (EHR), but it is still not known which oversampling method is efficient in imbalanced and insufficient EHR dataset. This study performed a comparative analysis of renowned oversampling methods (i.e., synthetic minority oversampling technique (SMOTE), borderline-SMOTE, and adaptive synthetic (ADASYN) sampling techniques) in constructing prognostic models for HF patients. All 299 patients had left ventricular systolic dysfunction, belonging to New York Heart Association class III and IV (Survival = 203, Deceased = 96). Follow up time was 4-285 days with an average of 130 days. The above three oversampling methods were compared in the case where the prognostic models were constructed by the random forest to predict mortality of patients with HF. The baseline model without oversampling method showed an F-score of 0.55. The oversampling method improved the F-score by 0.05 or more compared to the baseline model. SMOTE showed the highest prognostic capacity (F-score = 0.63) among the oversampling methods (F-score of borderline SMOTE = 0.60, ADASYN = 0.62). In all three oversampling methods, ejection fraction, serum creatinine, and age were consistently observed with high importance. Consequently, SMOTE is the most adequate algorithm for oversampling EHR data to predict mortality in HF patients.