[R] When using randomForest, what's the effect to "set.seed"?
daniel at umd.edu
Thu Aug 13 16:27:36 CEST 2009
if you set a seed manually, it makes the results reproducible. That is, if
you set a specific seed, your randomForest procedure should produce the
exact same result every time (all others equal). As an example:
Note that the last two random-normal draws (with seed 1234), even though
they are longer, reproduce the first 100 digits of the first two draws.
Without knowing the random forest library, I would think that the new seed
is set everytime to make sure that you don't draw one unlucky seed, but that
indeed setting different seeds aims at assuring "better randomness," as you
Chang, C-Y. wrote:
> When reading the random forest manual by Liaw, in the examples
> "set.seed" is always used before building a forest.
> Does it matter if I don't set the seed?
> If I set a different seed manually each time I build a forest, will this
> give better randomness?
> Thank you all in advance!
> EcoInformatics Lab
> Chun-yi Chang "Ted"
> Ecoinformatics Lab
> Institute of Oceanography
> National Taiwan University
> Tel : +886-2-3366-9746
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
View this message in context: http://www.nabble.com/When-using-randomForest%2C-what%27s-the-effect-to-%22set.seed%22--tp24952511p24954825.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help