ENH Add Array API compatibility to Binarizer - #31190
Conversation
…nto array-api/binarizer
|
@Tialo cc @OmarManzoor @ogrisel @betatim for review. |
|
Thanks for the PR @lithomas1 , I think we may still be trying to reach consensus on this: #26024 (comment) , also linking related issue: #28668 (Edit: I think this may be relevant for your other PR #31191 as well) |
|
@lucyleeow I think we discussed that it wouldn't make sense to support the array api for LabelBinarizer. This is a different class simple Binarizer so shouldn't we move forward with reviewing this PR? Or is there some other point that I am missing? |
|
@ogrisel may be better to clarify, but I am referring to this comment (#26024 (comment)):
AFAICT the crux of this discussion is:
Though there is also a case for letting the user handle namespace changes. Regardless, I don't think there is consensus on this yet? |
|
Yes I think the comment you are referring to is related to LabelBinarizer. Also for the metrics yes I think there is no consensus yet on how to handle the cases when y_pred and y_true are on different namespaces. |
|
Cool, do you know if the device issue is going to be brought up at the next array API meeting on Thursday?
Without having thought about this too much, I think y_true-follows-y_pred is probably the correct move here. I don't think this matters too much for metrics, though since they are cheap to compute. |
|
I don't see an entry (in the agenda notes) for the next meeting (this Thurs), but maybe this is due to Easter holidays? And I agree with you @OmarManzoor , I would love to see this work be able to move forward too. I'm just not clear on the status... |
|
Array API namespaces can only represent numerical arrays. They cannot represent things like Python or NumPy string values or pandas categorical values: those dtypes are not part of the array API spec. There is no point in adding array API support to
So it's perfectly meaningful to add array API support to it. And as far as I understand it's unrelated to the |
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
lucyleeow
left a comment
There was a problem hiding this comment.
LGTM, just seems like a lint issue.
And as far as I understand it's unrelated to the y_true-follows-y_pred discussion which is blocking further work on classification metrics.
Thanks for clarifying @ogrisel , it just didn't register that this was not a metric. To clarify, should we be proceeding with support of classification metrics?
Let's start with a documentation PR that explains the general policy to handle mixed namespace/devices inputs for metric functions ( |
|
I fixed the lint issue. |
Reference Issues/PRs
Resubmit/rebase of #27588
What does this implement/fix? Explain your changes.
Any other comments?