Turn seed into a np.random.RandomState instance.
If seed is None, return the RandomState singleton used by np.random. If seed is an int, return a new RandomState instance seeded with seed. If seed is already a RandomState instance, return it. Otherwise raise ValueError.
numpy.random.RandomStateThe random state object based on seed parameter.
>>> from sklearn.utils.validation import check_random_state >>> check_random_state(42) RandomState(MT19937) at 0x...
© 2007–2025 The scikit-learn developers
Licensed under the 3-clause BSD License.
https://scikit-learn.org/1.6/modules/generated/sklearn.utils.check_random_state.html