[MRG] Add a random seed for generating X in test_mlp.test_gradient()#13585
Merged
NicolasHug merged 5 commits intoscikit-learn:masterfrom Apr 7, 2019
Merged
Conversation
TomDLT
reviewed
Apr 6, 2019
| n_samples = 5 | ||
| n_samples = 100 | ||
| n_features = 10 | ||
| np.random.seed(42) |
Member
There was a problem hiding this comment.
This is usually not the way we do it.
To avoid changing the global random state, we prefer using:
rng = np.random.RandomState(42)
X = rng.random((n_samples, n_features))
Contributor
Author
There was a problem hiding this comment.
Ah! Makes sense. Will make the changes ✌️
jnothman
reviewed
Apr 6, 2019
| # should be close. | ||
| for n_labels in [2, 3]: | ||
| n_samples = 5 | ||
| n_samples = 100 |
Member
There was a problem hiding this comment.
I don't see what this helps. If it worked with 5 and that tests the functionality we seek, why change it?
Member
There was a problem hiding this comment.
Sorry, My bad, I suggested it to make the test more robust now that the random seed is fixed, but I was misled in thinking that the gradient was taken w.r.t the samples (too much gradient boosting I guess.)
numgrad and grad size is already 121 or 143 so this is not needed. Can you please revert @aditya1702 ?
LGTM otherwise
NicolasHug
approved these changes
Apr 6, 2019
Member
|
@NicolasHug, the green button is all yours to push!
|
Member
|
Thanks @aditya1702 ! |
jeremiedbb
pushed a commit
to jeremiedbb/scikit-learn
that referenced
this pull request
Apr 25, 2019
xhluca
pushed a commit
to xhluca/scikit-learn
that referenced
this pull request
Apr 28, 2019
xhluca
pushed a commit
to xhluca/scikit-learn
that referenced
this pull request
Apr 28, 2019
…ent() (scikit-learn#13585)" This reverts commit d2e3ff6.
xhluca
pushed a commit
to xhluca/scikit-learn
that referenced
this pull request
Apr 28, 2019
…ent() (scikit-learn#13585)" This reverts commit d2e3ff6.
koenvandevelde
pushed a commit
to koenvandevelde/scikit-learn
that referenced
this pull request
Jul 12, 2019
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
Fixes #13581
What does this implement/fix? Explain your changes.
Add a random seed to fix the random values generated for X. This ensures that the test does not fail on CI