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.
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)
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?