Skip to content

Fitted attributes are always numpy - #34667

Closed
betatim wants to merge 2 commits into
scikit-learn:mainfrom
betatim:bench-always-numpy-attrs
Closed

betatim wants to merge 2 commits into
scikit-learn:mainfrom
betatim:bench-always-numpy-attrs

Conversation

@betatim

@betatim betatim commented Aug 6, 2026 •

Copy link
Copy Markdown
Member

Reference Issues/PRs

#34604

What does this implement/fix? Explain your changes.

This is a first pass AI generated solution for storing all fitted attributes as Numpy and then converting them to the namespace/device of X in predict, transform, etc.

The goal of this is to have some code that we can benchmark. The question about this approach is if having to move the attributes back and forth costs (too much) performance.

This PR introduces a new config option "store_fitted_as_numpy" that controls the behaviour. Felt like an easy way to turn this on/off to make comparisons easy.

AI usage disclosure

I used AI assistance for:

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation

@betatim

betatim commented Aug 31, 2026

Copy link
Copy Markdown
Member Author

How well does this approach generalise to all the estimators that currently have array API support?

@betatim

betatim commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

Closing in favour of #35053

@betatim betatim closed this Oct 27, 2026
@betatim
betatim deleted the bench-always-numpy-attrs branch October 27, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants