I'm using a random forest in R (randomForest) to predict a binary output (1,0) for a dataset that is heavily unbalanced. In this example let's assume the population has 1% 1's and 99% 0's.
Building the random forest on such unbalanced data is difficult and I get much better results when building it on a 50:50 sample. When predicting a validation set, I obtain the % of trees that predicted that data point to be a 1. For example, customer A has a 75% probability of being a 1 (based on the # of trees that predicted 1)
If I want to re-scale these predictions back to the original population ratio of 1:99, is there a good way to do this?
In the past I've used logistic regression, and I can adjust the intercept accordingly to down-scale the predicted probability.
Is there a good way to think about this from the RF point of view? Can I simply just down-weight the predictions from the 50:50 sample by 50 (50% down to 1%)?
Thanks in advance for any thoughts and help