I want to do some classification of some dataset with random forest. When I run the same script twice, two totally different(almost 5%) result were given by the program. I want to know whether random forest always give the result that change a lot with the same parameters? How can I make it more stable?
The Random Forest algorithm involves a lot of randomization, as I assume you know (right?). So you will get somewhat different results each time you run it.
To obtain reproducible results, which is a good idea, initialize your random number generator with a fixed number. In R, you can do this with
set.seed(1), or with whatever other seed you want.
Be sure to investigate the effects of changing this seed, i.e., how sensitive your results are to your specific random number stream.