Bias Correction in Machine Learning-based Classification of Rare Events