Skip to content

Interactions between array API and sparse coefficients are not documented #34114

Closed

Description

@david-cortes-intel

Describe the issue linked to the documentation

Array API support was recently expanded to cover LogisticRegression, which allows having sparse coefficients:

self.coef_ = _align_api_if_sparse(sp.csr_array(self.coef_))

It's not expected that coefficients would have exact zeros with the supported solver 'lbfgs' for array API (although it can still happen when columns have the same value in all rows), but technically a user can still call .sparsify() on an estimator that was fitted to array API classes, in which case it will fail.

The documentation is not clear about limitations of LogisticRegression under array API, such as not being able to sparsify coefficients or not being able to make predictions if it somehow succeeds.

Suggest a potential alternative/fix

Documentation should be clear about limitations of methods from estimators when using array API classes.

Activity

  1. removed
    Needs Triage
    on May 26, 2026
  2. StefanieSenger commented on May 26, 2026

    @StefanieSenger
    Member

    Thanks for reporting, @david-cortes-intel! I agree on exploring the current behaviour and documenting it.

  3. sarveshvetrivel commented on May 26, 2026

    @sarveshvetrivel
    Contributor

    Hi, I'd like to work on this documentation issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions