Skip to content

TST Add common test for mixed y string and array API X for estimators #34094

Closed

Description

@lucyleeow

Discussed in: #33525 (comment) and #34065 (comment)

Add common estimator test for classifiers to check that string y and array API X input works for BOTH fit and score (see #33822) without raising errors and output type/shape is as expected:

  • y should be a container of string objects/dtype and we should parametrize over yield_namespace_device_dtype_combination for X (similar to the test_array_api_classification_mixed_string_numeric_input test)
  • array API dispatch should be enabled
    For fit check:
  • I think we can just check shape, dtype, namespace and device of output are as expected, see (see TST Add common test for mixed namespace/device array inputs to estimators #33525)
    • I think we can re-use _check_array_api_core but we either need to add an extra parameter to control data input generation, or refactor data generation out of _check_array_api_core

We may want to add the score check to _check_array_api_core as well.

cc @cakedev0 @ogrisel

Activity

  1. moved this to Todo in Array APIon May 23, 2026
  2. ogrisel commented on May 23, 2026

    @ogrisel
    Member

    Expanding _check_array_api_core will make it narural to also ch3ck .score with string labels in y.

  3. Rishab260 commented on May 24, 2026

    @Rishab260
    Contributor

    Can I take this one up? Thanks.

  4. StefanieSenger commented on May 24, 2026

    @StefanieSenger
    Member

    Hi @Rishab260, that's a rather complex PR that requires a few months of familiarity with Array API. I suppose @lucyleeow suggested that she would work on this or someone else from the core team.
    Your contributions so far look like you're careful, thoughtful and responsive, which is all very good, but they don't show familiarity with the topic. What about reviewing some array API related PRs first?

  5. Rishab260 commented on May 24, 2026

    @Rishab260
    Contributor

    Hi @Rishab260, that's a rather complex PR that requires a few months of familiarity with Array API. I suppose @lucyleeow suggested that she would work on this or someone else from the core team.
    Your contributions so far look like you're careful, thoughtful and responsive, which is all very good, but they don't show familiarity with the topic. What about reviewing some array API related PRs first?

    Hi @StefanieSenger, Thanks for your inputs. I appreciate it very much. Yes, I think reviewing API related PRs is something I could probably take up right now. Thanks. 😃

  6. moved this to In progress in Labson May 25, 2026
  7. ogrisel commented on May 28, 2026

    @ogrisel
    Member

    @lucyleeow I agree with this plan.

    As discussed in #33822 we can also consider a follow-up / extension to cover what happens when y is a pandas series with string values and X is an array API compliant input.

  8. moved this from In progress to Done in Labson Jul 1, 2026
  9. moved this from Todo to Done in Array APIon Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions