There is a huge number of posts saying that an imbalanced classes are bad. And only half explains it in terms of recall-presicion scores, meaning that accuracy can be high but F1 score low.

  1. What I do not understand is that why RF might perform bad on imbalanced class? I can train my model with respect to F1 score, accounting for recall and precision and also track the accuracy. So, why would then RF perform badly. (Some posts say imbalanced class is not a problem for RF, other state it is)

  2. Also, under sampling or oversampling are suggested. Imagine, I oversample the imbalanced class but then I need to adjust the thresholds for each class because my class distribution in train set does not match my class distribution in test set (and in fact in my real world set that will be given to the algorithm). In this case should my metrics be accuracy or F1 score?

  • 1
    $\begingroup$ There are also a large number of posts that contest the common wisdom that imblanced classes are bad: stats.stackexchange.com/questions/283170/…, stats.stackexchange.com/questions/247871/…, stats.stackexchange.com/questions/285231/… $\endgroup$ – Matthew Drury Jul 16 '17 at 23:06
  • $\begingroup$ Just a small follow up question that is not discussed there. Namely, once I oversample the data, I end up with two different class distributions in my train and test sets, what is also not that good. That means I will need to adjust the threshold of the probabilities for belonging to each of the class. Are there any references/post how to do it? $\endgroup$ – Tonja Jul 17 '17 at 8:48
  • $\begingroup$ Also, there are posts saying that RF are ok for imbalanced classes others (the one you mentioned) say is it a problem. Therefore, I asked specifically for RF why do exactly RF can have problems with it. $\endgroup$ – Tonja Jul 17 '17 at 9:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.