Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
ENH Array API support for f1_score and multilabel_confusion_matrix #27369
base: main
Are you sure you want to change the base?
ENH Array API support for f1_score and multilabel_confusion_matrix #27369
Changes from 11 commits
9bcbc4c
87b65b9
17457b9
c80617f
649ce17
8f0db56
6a02fcd
c150c9c
a01f2d7
aa2f521
75c7d5a
8b21b51
bc8c2df
ef33cf6
91ab0d5
696e65b
d0b647b
842e269
6e9596e
5cd9a11
2c3cc32
5c73766
0df1e0f
3d42289
78e4f31
74ccf6a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
We should probably make sure that it matches the device of the inputs, no? It's curious that existing tests do not fail with PyTorch and MPS device (or cuda devices).
I am also wondering of whether we should convert to a specific dtype. However looking at the tests I never see any case where we pass non-integer sample weights. And even for integer weights, it's only done to check an error message, not to check an actual computation. So I am not sure our
sample_weight
support is correct, even outside of array API concerns.I guess this is only indirectly tested by classification metrics that rely on
multilabel_confusion_matrix
internally. But then the array API compliance tests for F1 score do not fail with floating point weights (I just checked) and I am not sure why.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.
Here is the output of my cuda run on this PR (updated to check that boolean array indexing also works, but this should be orthogonal):