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

Skip to content

error in error message in compute_class_weight #8312

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
MMeketon opened this issue Feb 7, 2017 · 2 comments · Fixed by #8319
Closed

error in error message in compute_class_weight #8312

MMeketon opened this issue Feb 7, 2017 · 2 comments · Fixed by #8319

Comments

@MMeketon
Copy link
Contributor

MMeketon commented Feb 7, 2017

In the file class_weight.py, in the function compute_class_weight, is the piece of code:

for c in class_weight:
            i = np.searchsorted(classes, c)
            if i >= len(classes) or classes[i] != c:
                raise ValueError("Class label %d not present." % c)
            else:
                weight[i] = class_weight[c]

The line "Class label %d not present." % c fails if the class label is a string, not an integer.

@jnothman
Copy link
Member

jnothman commented Feb 7, 2017 via email

@MMeketon
Copy link
Contributor Author

MMeketon commented Feb 8, 2017 via email

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 a pull request may close this issue.

2 participants