To use a local random number generator you need to do 'rng = np.random.RandomState(random_state)' and later use 'rng.randn()' instead of 'np.random.randn()'