WIP: Enable array api support in neighbor
Description
Follow up PR of https://github.com/uxlfoundation/scikit-learn-intelex/pull/2284 (will rebase after this one is merged) that refactor neighbors with array api standard
Checklist:
Completeness and readability
- [ ] I have commented my code, particularly in hard-to-understand areas.
- [ ] I have updated the documentation to reflect the changes or created a separate PR with updates and provided its number in the description, if necessary.
- [ ] Git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details).
- [ ] I have resolved any merge conflicts that might occur with the base branch.
Testing
- [ ] I have run it locally and tested the changes extensively.
- [ ] All CI jobs are green or I have provided justification why they aren't.
- [ ] I have extended testing suite if new functionality was introduced in this PR.
Performance
- [ ] I have measured performance for affected algorithms using scikit-learn_bench and provided at least a summary table with measured data, if performance change is expected.
- [ ] I have provided justification why performance and/or quality metrics have changed or why changes are not expected.
- [ ] I have extended the benchmarking suite and provided a corresponding scikit-learn_bench PR if new measurable functionality was introduced in this PR.
As part of the PR, please add the relevant classes that will get array api support to this list now that they are documented: https://github.com/uxlfoundation/scikit-learn-intelex/blob/3d86aeb1bf09cc4e9f7741185a570222050ad3e2/doc/sources/array_api.rst?plain=1#L84
Codecov Report
:x: Patch coverage is 81.74157% with 65 lines in your changes missing coverage. Please review.
| Flag | Coverage Δ | |
|---|---|---|
| azure | 80.45% <81.46%> (-0.02%) |
:arrow_down: |
| github | ? |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files with missing lines | Coverage Δ | |
|---|---|---|
| sklearnex/neighbors/_lof.py | 100.00% <100.00%> (ø) |
|
| sklearnex/neighbors/knn_classification.py | 96.77% <90.90%> (-1.82%) |
:arrow_down: |
| sklearnex/neighbors/knn_unsupervised.py | 94.28% <82.35%> (-3.96%) |
:arrow_down: |
| onedal/neighbors/neighbors.py | 81.81% <69.23%> (+1.48%) |
:arrow_up: |
| sklearnex/neighbors/knn_regression.py | 86.40% <73.07%> (-11.96%) |
:arrow_down: |
| sklearnex/neighbors/common.py | 86.61% <82.47%> (-5.87%) |
:arrow_down: |
... and 4 files with indirect coverage changes
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
/intelci: run
/intelci: run
/intelci: run
/intelci: run
/intelci: run
/intelci: run
/intelci: run
/intelci: run
/intelci: run
The CI error appears to come from the changes in this PR:
File "<path>/build/onedal_linux_icx/__release_lnx/daal4py-3.9/onedal/neighbors/neighbors.py", line 137, in _fit
raise ValueError(
ValueError: Classification target processing must be done in sklearnex layer before calling onedal fit. _y attribute is not set. This indicates the refactoring is incomplete.
Note that it occurs when using the SPMD class:
File "<path>/examples/sklearnex/knn_bf_classification_spmd.py", line 64, in <module>
model_spmd.fit(dpt_X_train, dpt_y_train)
/intelci: run
/intelci: run
/intelci: run
/intelci: run
/intelci: run
/intelci: run
/intelci: run
/intelci: run
/intelci: run
/intelci: run
/intelci: run
/intelci: run
/intelci: run
/intelci: run
/intelci: run
/intelci: run
/intelci: run
/intelci: run