Bayesian analysis of the prevalence bias: learning and predicting from imbalanced data