I'm trying to fit a random forest regression and I'd like to obtain a distribution of my estimate by looking at the output of every regression tree in the ensemble, returned to me in some sort of list. In R, providing the predict.all
option in the randomForest
predict method does this for me, Is there any way to do this in the RandomForestRegressor
class in sklearn?
In 0.13 and above, I see the method apply which returns leaf indices, however I'm not sure how to use these, and I don't see any more clues in the doc for RandomForestRegressor
.
Thanks for you help.
Can you upgrade to 0.14? In 0.14, there is an estimators_ member that gives you access to the individual trees. See the RandomForestRegressor docs.