-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Ensure that the shape of sample_weight is checked in all the functions #9926
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
Comments
Clearer error messages is always better, so I would fix the problems you found and add tests. |
Thanks :)
You mean to assign it to yourself? Otherwise, I think I'll try it recently. Or you can also tag it to attract others since my work on it will not start too soon. |
I don't think @lesteve's intention was to assign it to himself |
No it was only a recommendation ;-). |
Thanks to you all for the instant reply :) |
@qinhanmin2014 If I understand correctly, what could be done to fix this issue is:
Is that the way to go? |
@jbschiratti Sorry for the late reply |
Closing as I think this is superseded by |
Ropening since this was not fully addressed, and there a few related open PRs. |
proposed by @lesteve in #9786 (comment) and #9903 (comment)
After going through all the public functions, it seems that the following functions do not check the shape of sample_weight and rely on certain statement to block the code from running through. (See #9903 (comment) for more detail)
This may cause:
(1)Users can't get meaningful error message (e.g., now you may get something like operands could not be broadcast together with shapes (2,1) (3,1))
(2)Sometimes all the statements fail to block the code and you even can't get an erorr (e.g., roc_auc_score previously)
It is not difficult to fix the code but the core issue here is how to test it in an elegant way. Also see #5367, #5515.
The text was updated successfully, but these errors were encountered: