-
Notifications
You must be signed in to change notification settings - Fork 184
WIP: Enable array api support in neighbor #2700
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
base: main
Are you sure you want to change the base?
WIP: Enable array api support in neighbor #2700
Conversation
sklearnex/neighbors/_lof.py
Outdated
|
||
from onedal.utils.validation import _check_array | ||
|
||
X = _check_array(X, accept_sparse="csr", dtype=[np.float64, np.float32]) |
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.
Shouldn't it extract the namespace to get the dtypes, as done elsewhere? For example:
dtype=[xp.float64, xp.float32], |
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.
There are lots of parts in onedal neighbor we need to move to sklearnex, and I plan to do array api stuff after this step to avoid too much changes at once
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.
I'd prefer to have all the changes in one PR as they'd be modifying the same parts.
sklearnex/neighbors/_lof.py
Outdated
if X is not None: | ||
check_feature_names(self, X, reset=False) | ||
# Perform preprocessing at sklearnex level | ||
import numpy as np |
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.
NumPy is a mandatory dependency so it could be imported at the top level.
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.
Thx, removed!
25b3930
to
debfcdf
Compare
a569e0c
to
62c8ddd
Compare
As part of the PR, please add the relevant classes that will get array api support to this list now that they are documented:
|
Description
Follow up PR of #2284 (will rebase after this one is merged)
that refactor neighbors with array api standard
Checklist:
Completeness and readability
Testing
Performance