We address the problem of predicting the occurrence of infrequent adverse events in the context of predictive maintenance. We cast the corresponding machine learning task as an imbalanced classification problem and propose a framework for solving it that is capable of leveraging different classifiers in order to predict the occurrence of an adverse event before it takes place. In particular, we focus on two applications arising in low-carbon energy production: foam formation in anaerobic digestion and condenser tube leakage in the steam turbines of a nuclear power station. The results of an extensive set of omputational experiments show the effectiveness of the techniques that we propose.