[Numpy-discussion] NEP: Random Number Generator Policy
robert.kern at gmail.com
Mon Jun 11 03:29:33 EDT 2018
On Sun, Jun 10, 2018 at 11:44 PM Ralf Gommers <ralf.gommers at gmail.com>
> Note that scipy.stats distributions allow passing in either a RandomState
instance or an integer as seed (which will be used for seeding a new
instance, not for np.random.seed) . That seems like a fine design
pattern as well, and passing on a seed that way is fairly easy and as good
for reproducibility as passing in a single PRNG.
Well, carefully. You wouldn't want to pass on the same integer seed to
multiple functions. Accepting an integer seed is super-convenient at the
command line/notebooks, though, or docstrings or in tests or other
situations where your "reproducibility horizon" is small. These utilities
are good for scaling from these small use cases to up to large ones.
scikit-learn is also a good example of good PRNG hygiene:
>> > Also, if there is to be a multi-year transitioning to the new API,
would there be two PRNG systems anyway during those years?
>> Sure, but with a deadline and not-just-documentation to motivate
>> But if we follow my alternative proposal, there'll be no need for
deprecation! You've convinced me to not deprecate RandomState.
> That's not how I had read it, but great to hear that!
Indeed, I did deprecate the name RandomState in that drafting, but it's not
really necessary, and you've convinced me that we shouldn't do it.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion