Don't use global np.random.seed in tests#13356
Merged
agramfort merged 8 commits intoscikit-learn:masterfrom Mar 2, 2019
Merged
Don't use global np.random.seed in tests#13356agramfort merged 8 commits intoscikit-learn:masterfrom
agramfort merged 8 commits intoscikit-learn:masterfrom
Conversation
…into Don't_use_global_np.random.seed_in_tests
rth
reviewed
Mar 1, 2019
- passed rng as parameter to ParameterSampler class - changed seed from 0 to 42 (as original)
- passed rng as parameter to SparseRandomProjection class
- passed rng as parameter to GaussianRandomProjection class
Contributor
Author
|
@rth - all tests have passed now |
Member
|
thx @praths007 |
xhluca
pushed a commit
to xhluca/scikit-learn
that referenced
this pull request
Apr 28, 2019
* initial commit * used random class * fixed failing testcases, reverted __init__.py * fixed failing testcases #2 - passed rng as parameter to ParameterSampler class - changed seed from 0 to 42 (as original) * fixed failing testcases #2 - passed rng as parameter to SparseRandomProjection class * fixed failing testcases scikit-learn#4 - passed rng as parameter to GaussianRandomProjection class * fixed failing test case because of flake 8
xhluca
pushed a commit
to xhluca/scikit-learn
that referenced
this pull request
Apr 28, 2019
This reverts commit 12c080d.
xhluca
pushed a commit
to xhluca/scikit-learn
that referenced
this pull request
Apr 28, 2019
This reverts commit 12c080d.
koenvandevelde
pushed a commit
to koenvandevelde/scikit-learn
that referenced
this pull request
Jul 12, 2019
* initial commit * used random class * fixed failing testcases, reverted __init__.py * fixed failing testcases scikit-learn#2 - passed rng as parameter to ParameterSampler class - changed seed from 0 to 42 (as original) * fixed failing testcases scikit-learn#2 - passed rng as parameter to SparseRandomProjection class * fixed failing testcases scikit-learn#4 - passed rng as parameter to GaussianRandomProjection class * fixed failing test case because of flake 8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
Don't use global np.random.seed in tests #13345
What does this implement/fix? Explain your changes.
Replaced instances in tests and doctests where seed was set globally using
np.random.seedwithrng = np.random.RandomStateso that the class variable
rngcan be used to generate random numbers instead of the global value of seed set using np.random.seed.Any other comments?
Issue #13345 can be checked for more details