check_random_state¶
- artpop.util.check_random_state(seed)[source]¶
Turn seed into a
RandomStateinstance.- Parameters
- seed
None, int, list of ints, orRandomState If
seedisNone, return theRandomStatesingleton used bynumpy.random. Ifseedis anint, return a newRandomStateinstance seeded withseed. Ifseedis 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.