question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting random_state and np.random.seed does not ensure reproducibility

See original GitHub issue

I think it would be great and make things a lot easier, if there would be a top level API for scikit-learn

scikit-learn.set_random_seed

This would help a lot for reproducibility as one would not have to remember setting random states for each algorithm that is called. This has to deal with multiprocessing though I guess.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:27 (13 by maintainers)

github_iconTop GitHub Comments

5reactions
maxnoecommented, Dec 1, 2017

I’m asking, because right now I have problems with reproducibility. I set the np.random.seed as well as each algorithms random state, however the results are still a bit different each time a run the scripts.

3reactions
maxnoecommented, Dec 1, 2017

This looks like a multiprocessing issue. When I run this with n_jobs=1 It seems that I always get the same result.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get absolutely reproducible results with Scikit Learn?
I just was playing with numpy and as well with sklearn . Apparently, setting np.random.seed does not guarantee a fixed random state for ......
Read more >
Stop Using NumPy's Global Random Seed - Built In
Using np.random.seed(number) has been a best practice when using NumPy to create reproducible work. Setting the random seed means that your ...
Read more >
Random Seeds and Reproducibility - Towards Data Science
In pure Python, you use random.seed() to set the seed, and then you may use random.randint() to draw ... Who said ensuring reproducibility...
Read more >
Properly Setting the Random Seed in ML Experiments. Not as ...
The good news is that by carefully setting the random seed across your pipeline you can achieve reproducibility. The “seed” is a starting...
Read more >
Good practices with numpy random number generators
random.seed function. Fixing the seed at the beginning ensures that the script is reproducible: the same values and results will be produced ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found