skactiveml.utils.check_random_state#

skactiveml.utils.check_random_state(random_state, seed_multiplier=None)[source]#

Check validity of the given random state.

Parameters
random_stateNone | int | instance of RandomState

If random_state is None, return the RandomState singleton used by np.random. If random_state is an int, return a new RandomState. If random_state is already a RandomState instance, return it. Otherwise raise ValueError.

seed_multiplierNone | int, optional (default=None)

If the random_state and seed_multiplier are not None, draw a new int from the random state, multiply it with the multiplier, and use the product as the seed of a new random state.

Returns
random_state: instance of RandomState

The validated random state.