2
$\begingroup$

There's one parameter in RandomForestRegressor which is bootstrap. By default bootstrap=True

bootstrap : boolean, optional (default=True)

Whether bootstrap samples are used when building trees.

So from the docs if I set bootstrap=False then I guess bootstrap samples are not used but I'm really confused on what is bootstrap samples mean here?

There were explanations but it's really confusing. Can someone please explain it in a simpler term? And also does bootstrap=True help in improving the model accuracy?

Thank you.

$\endgroup$

2 Answers 2

1
$\begingroup$

Refer this answer on stack

The benefit of random forests comes from its creating a large variety of trees by sampling both observations and features. Bootstrap = False is telling it to sample observations with or without replacement - it should still sample when it's False, just without replacement... You tell it what share of features you want to sample by setting max_features..

$\endgroup$
1
  • $\begingroup$ So correct me If i'm wrong but if bootstrap=True then for every tree we pick random sample of data but rows from one tree may also present in another tree but if we choose bootstrap=False everything will be unique. If I'm not correct can you explain it in simpler term. $\endgroup$
    – Sai Kumar
    Nov 18, 2018 at 18:46
1
$\begingroup$

The newer documentation clears this up:

bootstrap : boolean, optional (default=True)

Whether bootstrap samples are used when building trees. If False, the whole datset is used to build each tree.

Setting it to False makes the random subsetting of features the only randomness; every tree sees the entire training dataset.

$\endgroup$

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.