I am using RandomForest regressor on my data and I could see that the oob score was obtained to be 0.83. I am not sure how it came out to be like this. I mean my targets are high values in the range of 10^7. So if it's MSE then it should have been much higher. I don't understand what 0.83 signify here.

I am using python's RandomForestRegressor of the sklearn toolkit.

I do

model = RandomForestRegressor(max_depth=7, n_estimators=100, oob_score=True, n_jobs=-1) model.fit(trainX, trainY )

Then I see model.oob_score_ and I get values like 0.83809026152005295

  • $\begingroup$ @Momo. I am using python's sklearn.ensemble's RandomForestRegressor. I just use the model like $\endgroup$
    – user34790
    Sep 23, 2013 at 16:13

1 Answer 1


In order to compare the ground truth (i.e. correct/actual) target values with estimated (i.e. predicted) target values by the random forest , scikit-learn doesn't use the MSE but $R^2$ (unlike e.g. MATLAB or (Breiman 1996b)), as you can see in the code of forest.py:

self.oob_score_ = 0.0
for k in xrange(self.n_outputs_):
    self.oob_score_ += r2_score(y[:, k], predictions[:, k])
self.oob_score_ /= self.n_outputs_

r2_score() computes the coefficient of determination aka. R2, whose best possible score is 1.0, and lower values are worse.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.