Skip to content

Commit

Permalink
MAINT: avoid modifying of RandomState object (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
adriangb authored Jan 16, 2021
1 parent 08f8239 commit 312b144
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scikeras/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,8 +762,9 @@ def _initialize(
# Given the same RandomState, the seed will always be
# the same, thus giving reproducible results
state = self.random_state.get_state()
self._random_state = self.random_state.randint(low=1)
self.random_state.set_state(state)
r = np.random.RandomState()
r.set_state(state)
self._random_state = r.randint(low=1)
else:
# int or None
self._random_state = self.random_state
Expand Down

0 comments on commit 312b144

Please sign in to comment.