Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reproducibility and random seed #1368

Open
erikcs opened this issue Oct 12, 2023 · 1 comment
Open

Reproducibility and random seed #1368

erikcs opened this issue Oct 12, 2023 · 1 comment

Comments

@erikcs
Copy link
Member

erikcs commented Oct 12, 2023

In order for a grf forest to produce the same results on different machines, in addition to the sameseed argument, it also needs the same num.threads argument, as pointed out in the online reference

Therefore, in order to ensure consistent results, we provide the following recommendations.

Make sure arguments seed and num.threads are the same across platforms
Round data to 8 significant digits)

Since this sometimes comes up (#1262) it would be good to also state this in the R documentation for the seed argument.

(making results independent of num.threads would be ideal and straight-forward to do - #1263, but unfortunately, it would be a breaking change, changing results for people who expect the old behavior, and so for now it's reasonable to just keep it this way).

@erikcs
Copy link
Member Author

erikcs commented Sep 24, 2024

UPDATE:

We've finally decided to change the default GRF behavior to not have the random seed interact with the number of threads used to train the forest (#1447). This will hopefully make journal submissions which now have strict reproducibility requirements easier for researchers.

We will treat this as bug fix in the next grf minor release 2.4.0 where we also add a backwards compatibility option for researchers who wish to reproduce past results exactly without reinstalling a previous version of grf. In order to do that, you'd add options(grf.legacy.seed=TRUE) to the top of your R script.

Thank you very much to @sebp for nudging us towards finally fixing this.

@erikcs erikcs changed the title Mention reproducibility in seed argument docstring Reproducibility and random seed Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant