I grew a random forest model (using cforest of the package 'party') on a dataset containing approximately 1000 observations of 7 variables. The response is binary (say outcome A and outcome B) and the 6 predictors are all categorical. My problem is that I would like to get the probability of each of the 1000 outcomes like in a logistic regression model. In the latter case, we can use predict(yourmodel, type="response") to get the probability of each outcome, in which case outcome A is favoured when p<0.5 and outcome B is favoured when p>=0.5.
It appears that when applying predict on a random forest object, I only get the predicted outcome (i.e. A or B) for each observation. Is there a workaround to retrieve the probability of the predicted response?
I thank you very much for your help!
C.B.