-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
[MRG+1] Add sample_weight parameter to metrics.jaccard_similarity_score #3497
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
jatinshah
commented
Jul 29, 2014
- Include this metric in sample_weight test in tests/test_common.py
- Include this metric in sample_weight test in tests/test_common.py
@@ -237,7 +238,7 @@ def confusion_matrix(y_true, y_pred, labels=None): | |||
return CM | |||
|
|||
|
|||
def jaccard_similarity_score(y_true, y_pred, normalize=True): | |||
def jaccard_similarity_score(y_true, y_pred, normalize=True, sample_weight=None): |
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.
Please limit line length to 79 chars, in accordance with PEP8
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.
OK, will fix.
Could you document your improvement in the what's new? |
@arjoly Sure, can describe the improvements. Where is What's New located? |
@arjoly - Any idea why the test is failing? The detailed CI logs say that values with sample_weight=None and sample_weight=ones for unnormalized Jaccard are not same. The error log also displays the values as 105.20595238095238 and 105.20595238095237 |
doc/whats_new.rst On 29 July 2014 23:13, Coveralls [email protected] wrote:
|
This looks some tests are checking assert equal instead of assert almost equal |
And this test does not fail on my local machine - so not sure what is going on. |
Is it ok to change the failing tests to assert almost equal instead of equal? |
- Replace sample weight invariance tests to check for almost equal instead of equal
Yes. On 30 July 2014 14:14, Jatin Shah [email protected] wrote:
|
OK. It's done. |
............ | ||
|
||
|
||
- Add ``sample_weight`` parameter to `metrics.jaccard_similarity_score`. |
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.
please include this under 0.16
LGTM! |
The small variations are due to small floating point arithmetic errors. Asserting that 6 decimals (the default of assert_almost_equal) is enough to check correctness and equality in most cases. |
+1 I am going to merge by rebase ! |
Merge by rebase 1b2833a. Thanks and congratulation for your first contribution. |
Thanks @arjoly. |