check_random_state¶
- artpop.util.check_random_state(seed)[source]¶
Turn seed into a
RandomState
instance.- Parameters
- seed
None
, int, list of ints, orRandomState
If
seed
isNone
, return theRandomState
singleton used bynumpy.random
. Ifseed
is anint
, return a newRandomState
instance seeded withseed
. Ifseed
is already aRandomState
, return it. Otherwise raiseValueError
.
- seed
- Returns
- random_state
RandomState
RandomState object.
- random_state
Notes
This routine is adapted from scikit-learn. See http://scikit-learn.org/stable/developers/utilities.html#validation-tools.