File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ def test_oob_score_classification():
188
188
"""Check that oob prediction is as acurate as
189
189
usual prediction on the training set.
190
190
Not really a good test that prediction is independent."""
191
- clf = RandomForestClassifier (oob_score = True )
191
+ clf = RandomForestClassifier (oob_score = True , random_state = rng )
192
192
clf .fit (X , y )
193
193
training_score = clf .score (X , y )
194
194
assert_almost_equal (training_score , clf .oob_score_ )
@@ -197,7 +197,8 @@ def test_oob_score_classification():
197
197
def test_oob_score_regression ():
198
198
"""Check that oob prediction is pessimistic estimate.
199
199
Not really a good test that prediction is independent."""
200
- clf = RandomForestRegressor (n_estimators = 50 , oob_score = True )
200
+ clf = RandomForestRegressor (n_estimators = 50 , oob_score = True ,
201
+ random_state = rng )
201
202
n_samples = boston .data .shape [0 ]
202
203
clf .fit (boston .data [:n_samples / 2 , :], boston .target [:n_samples / 2 ])
203
204
test_score = clf .score (boston .data [n_samples / 2 :, :],
You can’t perform that action at this time.
0 commit comments