Heart failure (HF) is currently the leading cause of morbidity and mortality worldwide. Identifying the risk of mortality at the early stages is crucial to reducing the mortality rate. However, the traditional methods for exploring the signs of mortality are difficult and time-consuming. Whereas, machine learning (ML) methods are superior in reducing HF’s mortality rate by providing early warnings. This study presents a novel ML classifier called imperial boost-stacked (IBS) that can serve as an effective early warning system for predicting HF mortality. Initially, we performed an efficient data balancing technique named synthetic minority oversampling technique with edited nearest neighbors (SMOTE-ENN) to mitigate the imbalance problem. Next, two well-known feature selection techniques, the extra tree (ET) and information gain (IG), are applied to reduce the data dimensions and select the most significant features. Following that, the prepared feature sets are trained with our proposed IBS classifier. Simultaneously leveraging the advantages of Boosting, Stacking, and multiple robust methods, it significantly correlates with the intricate patterns of clinical data of HF patients. Finally, the robust outcomes of 92.75% accuracy over existing studies reveal that our proposed study can effectively warn the HF mortality at early stages and reduce the burden on the healthcare sector.