-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
[MRG] Fixing wrapping in named_test.test_common #8558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The Travis error is a flake8 error that you need to fix. Please invest some time to configure on-the-fly flake8 checks inside your editor of choice. This allows you to spot these kind of problems while editing. |
# matrix instead of a number. Testing of | ||
# confusion_matrix with sample_weight is in | ||
# test_classification.py | ||
"confusion_matrix", # Left this one here because the tests in this file do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine for now but from next time kindly avoid unrelated changes :)
invalids =[([0, 1], [np.inf, np.inf]), | ||
([0, 1], [np.nan, np.nan]), | ||
([0, 1], [np.nan, np.inf])] | ||
invalids = [([0, 1], [np.inf, np.inf]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as above
def test_sample_weight_invariance(n_samples=50): | ||
# iterate through each metric testing each case | ||
for metrics in generate_sample_weight_invariance(n_samples): | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the original issue as I commented there and I don't think you need this since nose supports yield in test functions ...
Does this PR fixes the corresponding issue? Otherwise I might want to try to fix this. |
I am going to close this PR due to lack of activity. |
Reference Issue #8507
What does this implement/fix? Explain your changes.
The issue is common to five functions. Not only test_sample_weight_invariance. However, this pull request only fixes test_sample_weight_invariance.
The functions:
are generative functions made to yield a particular output. However, the test simply calls the generator function without iterating through them. This change fixes that, by defining an additional function to iterate through each metric.
Any other comments?
These functions were added in commit #7620.