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$
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..

| improve this answer | |
$\endgroup$
  • $\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 '18 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.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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