You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we are fixing the random_state using a decorator that wraps around the desired functions (sample). This wrapper sets the global random state to the model's desired random state and then resets it after the function has completed.
Instead of setting and unsetting the global random state, we can pass this state through to the scipy functions being called and/or use this global state to execute random method calls.
We can also change np.random library calls to be on the model's self.random_state.
For example:
self.random_state.rand()
Expected behavior
As a result of this change, the global random state (np.random.get_state()) will not be altered. The generated sample data should still follow the progression of the specified seed or random state.
The text was updated successfully, but these errors were encountered:
Problem Description
Currently, we are fixing the random_state using a decorator that wraps around the desired functions (sample). This wrapper sets the global random state to the model's desired random state and then resets it after the function has completed.
Instead of setting and unsetting the global random state, we can pass this state through to the
scipy
functions being called and/or use this global state to execute random method calls.For example, this sample function could be:
We can also change
np.random
library calls to be on the model'sself.random_state
.For example:
Expected behavior
As a result of this change, the global random state (
np.random.get_state()
) will not be altered. The generated sample data should still follow the progression of the specified seed or random state.The text was updated successfully, but these errors were encountered: