[scikit-learn] NEP: Random Number Generator Policy

Robert Kern robert.kern at gmail.com
Sat Jun 16 03:59:26 EDT 2018


I have made a significant revision. In this version, downstream projects like 
scikit-learn should experience significantly less forced churn.

https://github.com/rkern/numpy/blob/nep/rng-clarification/doc/neps/nep-0019-rng-policy.rst

https://mail.python.org/pipermail/numpy-discussion/2018-June/078252.html

tl;dr RandomState lives! But its distributions are forever frozen. So maybe 
"undead" is more apt. Anyways, RandomState will continue to provide the same 
stream-compatibility that it always has. But it will be internally refactored to 
use the same core uniform PRNG objects that the new RandomGenerator 
distributions class will use underneath (defaulting to the current Mersenne 
Twister, of course). The distribution methods on RandomGenerator will be allowed 
to evolve with numpy versions and get better/faster implementations.

Your code can mix the usage of RandomState and RandomGenerator as needed, but 
they can be made to share the same underlying RNG algorithm's state.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco



More information about the scikit-learn mailing list