Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[WIP]Sample weight support to hamming loss #4067

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

Closed
wants to merge 1 commit into from

Conversation

akshayah3
Copy link
Contributor

Partial fix for #3450
Have to add tests, should i test this in the corresponding hamming_loss tests in test_classification?

@jnothman
Copy link
Member

jnothman commented Jan 8, 2015

marking this as supporting sample weights in the common metrics tests should suffice.

n_differences = count_nonzero(y_true - y_pred)
a = y_true - y_pred
n_differences = sum([count_nonzero(a[i])*sample_weight[i]
for i in xrange(a.shape[0])])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use range for python 3 compatibility.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

count_nonzero supports weight and axis calculations...

@TomDLT
Copy link
Member

TomDLT commented Jan 4, 2016

I close wrt #5465

@TomDLT TomDLT closed this Jan 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants