Skip to content

update: update algorithm.rst based on current implementation #2354

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

Merged
merged 34 commits into from
Jun 11, 2025
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
edf9767
update: update aldorithm and preview
yuejiaointel Mar 13, 2025
bf35828
fix: remove incremental algos and added extra trees and tsne n_compoe…
yuejiaointel Mar 14, 2025
3e26ed7
Merge branch 'main' into update_doc_algo_section
yuejiaointel Apr 1, 2025
577e3c7
Merge branch 'main' into update_doc_algo_section
yuejiaointel May 28, 2025
6f71455
fix: fix basic stats
yuejiaointel May 28, 2025
77961ac
fix: fix basic stats
yuejiaointel May 28, 2025
a828247
fix: went through all algos
yuejiaointel May 28, 2025
d13976c
fix: address comments
yuejiaointel May 29, 2025
8dbe4be
fix move incremental imiltaiton under notes
yuejiaointel May 29, 2025
ac4f716
fix: add notes in other incremental algos
yuejiaointel May 30, 2025
aea2286
fix: sklearn < 1.5
yuejiaointel May 30, 2025
871439d
fix: removed versions
yuejiaointel May 30, 2025
b5d7dce
Update doc/sources/algorithms.rst
yuejiaointel May 30, 2025
faaa0f9
fix: various chagnes based on comments
yuejiaointel May 30, 2025
7c96c70
fix: add verbose note
yuejiaointel May 30, 2025
e50bc86
Update doc/sources/algorithms.rst
yuejiaointel May 30, 2025
50213df
fix: verbose html
yuejiaointel May 30, 2025
63e2dab
fix: verbose note
yuejiaointel May 30, 2025
8faaa00
fix: address comments
yuejiaointel May 31, 2025
9030a0e
fix: increoemtn notes
yuejiaointel May 31, 2025
ec0ba3b
fix: verbose
yuejiaointel May 31, 2025
4a7f5d5
fix: LogisticRegression
yuejiaointel Jun 5, 2025
f74d41e
fix: doc ci
yuejiaointel Jun 5, 2025
f06e1a0
fix: fix basic stats format
yuejiaointel Jun 6, 2025
469739c
fix: fix basic stats
yuejiaointel Jun 6, 2025
327a474
fix: fix basic stats
yuejiaointel Jun 6, 2025
e7af7d1
fix: format
yuejiaointel Jun 6, 2025
ecb166f
fix: fix indent
yuejiaointel Jun 6, 2025
a811198
fix: format
yuejiaointel Jun 6, 2025
427002c
Merge branch 'main' into update_doc_algo_section
yuejiaointel Jun 6, 2025
f8db999
fix: address comments
yuejiaointel Jun 6, 2025
94ac2ee
fix: fix logistic regression cpu
yuejiaointel Jun 9, 2025
ef5209b
fix: fix logistic regression cpu
yuejiaointel Jun 9, 2025
71a32a2
fix: fix spmd logistic regression
yuejiaointel Jun 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 118 additions & 22 deletions doc/sources/algorithms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
Supported Algorithms
####################

.. note::
To verify that oneDAL is being used for these algorithms, you can enable verbose mode.
See :ref:`verbose` for details.

Applying |sklearnex| impacts the following |sklearn| estimators:

on CPU
Expand Down Expand Up @@ -48,6 +52,13 @@ Classification
- ``ccp_alpha`` != `0`
- ``criterion`` != `'gini'`
- Multi-output and sparse data are not supported
* - `ExtraTreesClassifier`
- All parameters are supported except:

- ``warm_start`` = `True`
- ``ccp_alpha`` != `0`
- ``criterion`` != `'gini'`
- Multi-output and sparse data are not supported
* - `KNeighborsClassifier`
-
- For ``algorithm`` == `'kd_tree'`:
Expand Down Expand Up @@ -89,6 +100,13 @@ Regression
- ``ccp_alpha`` != `0`
- ``criterion`` != `'mse'`
- Multi-output and sparse data are not supported
* - `ExtraTreesRegressor`
- All parameters are supported except:

- ``warm_start`` = `True`
- ``ccp_alpha`` != `0`
- ``criterion`` != `'mse'`
- Multi-output and sparse data are not supported
* - `KNeighborsRegressor`
- All parameters are supported except:

Expand All @@ -97,16 +115,17 @@ Regression
* - `LinearRegression`
- All parameters are supported except:

- ``normalize`` != `False`
- ``sample_weight`` != `None`
- ``positive`` = `True`
- Only dense data is supported.
* - `Ridge`
- All parameters are supported except:

- ``normalize`` != `False`
- ``solver`` != `'auto'`
- ``sample_weight`` != `None`
- ``positive`` = `True`
- Only dense data is supported, `#observations` should be >= `#features`.
- ``alpha`` must be scalar
* - `ElasticNet`
- All parameters are supported except:

Expand All @@ -132,9 +151,14 @@ Clustering
* - `KMeans`
- All parameters are supported except:

- ``precompute_distances``
- ``sample_weight`` != `None`
- No limitations
- ``algorithm`` != `'lloyd'` ('elkan' falls back to 'lloyd')
- ``n_clusters`` = `1`
- ``sample_weight`` must be `None` for predict
- ``sample_weight`` must be `None` or all ones for fit
- ``Init`` = `'k-means++'` fallbacks to CPU
- Supported data formats:
- Dense data
- CSR sparse matrices
* - `DBSCAN`
- All parameters are supported except:

Expand All @@ -156,16 +180,16 @@ Dimensionality Reduction
* - `PCA`
- All parameters are supported except:

- ``svd_solver`` not in [`'full'`, `'covariance_eigh'`]
- Sparse data is not supported
* - `IncrementalPCA`
- All parameters are supported
- ``svd_solver`` not in [`'full'`, `'covariance_eigh'`, `'onedal_svd'`]
- For |sklearn| < 1.5: `'full'` solver is automatically mapped to `'covariance_eigh'`
- Sparse data is not supported
* - `TSNE`
- All parameters are supported except:

- ``metric`` != 'euclidean' or `'minkowski'` with ``p`` != `2`

- ``n_components`` can only be `2`

Refer to :ref:`TSNE acceleration details <acceleration_tsne>` to learn more.
- Sparse data is not supported

Expand Down Expand Up @@ -204,9 +228,18 @@ Other Tasks
* - `EmpiricalCovariance`
- All parameters are supported
- Only dense data is supported
* - `BasicStatistics`
- All parameters are supported
- Supported data formats:
- Dense data
- CSR sparse matrices
- Sample weights **not** supported for CSR data format
* - `train_test_split`
- All parameters are supported
- Only dense data is supported
- Only integer and 32/64-bits floating point types are supported
- Data with more than 3 dimensions is not supported
- The input has to be a np.ndarray object
* - `assert_all_finite`
- All parameters are supported
- Only dense data is supported
Expand All @@ -215,6 +248,8 @@ Other Tasks

- ``metric`` not in [`'cosine'`, `'correlation'`]
- Only dense data is supported
- ``Y`` must be `None`
- Input dtype must be `np.float64`
* - `roc_auc_score`
- All parameters are supported except:

Expand Down Expand Up @@ -255,6 +290,15 @@ Classification
- ``oob_score`` = `True`
- ``sample_weight`` != `None`
- Multi-output and sparse data are not supported
* - `ExtraTreesClassifier`
- All parameters are supported except:

- ``warm_start`` = `True`
- ``ccp_alpha`` != `0`
- ``criterion`` != `'gini'`
- ``oob_score`` = `True`
- ``sample_weight`` != `None`
- Multi-output and sparse data are not supported
* - `KNeighborsClassifier`
- All parameters are supported except:

Expand All @@ -269,6 +313,12 @@ Classification
- ``class_weight`` != `None`
- ``sample_weight`` != `None`
- ``penalty`` != `'l2'`
- ``dual`` = `True`
- ``intercept_scaling`` != `1`
- ``multi_class`` != `'multinomial'`
- ``warm_start`` = `True`
- ``l1_ratio`` != `None`
- Only binary classification is supported
- Only dense data is supported

Regression
Expand All @@ -291,6 +341,15 @@ Regression
- ``oob_score`` = `True`
- ``sample_weight`` != `None`
- Multi-output and sparse data are not supported
* - `ExtraTreesRegressor`
- All parameters are supported except:

- ``warm_start`` = `True`
- ``ccp_alpha`` != `0`
- ``criterion`` != `'mse'`
- ``oob_score`` = `True`
- ``sample_weight`` != `None`
- Multi-output and sparse data are not supported
* - `KNeighborsRegressor`
- All parameters are supported except:

Expand All @@ -301,8 +360,8 @@ Regression
* - `LinearRegression`
- All parameters are supported except:

- ``normalize`` != `False`
- ``sample_weight`` != `None`
- ``positive`` = `True`
- Only dense data is supported.

Clustering
Expand All @@ -319,10 +378,14 @@ Clustering
* - `KMeans`
- All parameters are supported except:

- ``precompute_distances``
- ``sample_weight`` != `None`
- ``Init`` = `'k-means++'` fallbacks to CPU.
- Sparse data is not supported
- ``algorithm`` != `'lloyd'` ('elkan' falls back to 'lloyd')
- ``n_clusters`` = `1`
- ``sample_weight`` must be `None` for predict
- ``sample_weight`` must be `None` or all ones for fit
- ``Init`` = `'k-means++'` fallbacks to CPU
- Supported data formats:
- Dense data
- CSR sparse matrices
* - `DBSCAN`
- All parameters are supported except:

Expand All @@ -344,7 +407,8 @@ Dimensionality Reduction
* - `PCA`
- All parameters are supported except:

- ``svd_solver`` not in [`'full'`, `'covariance_eigh'`]
- ``svd_solver`` not in [`'full'`, `'covariance_eigh'`, `'onedal_svd'`]
- For |sklearn| < 1.5: `'full'` solver is automatically mapped to `'covariance_eigh'`
- Sparse data is not supported

Nearest Neighbors
Expand Down Expand Up @@ -380,6 +444,11 @@ Other Tasks
* - `EmpiricalCovariance`
- All parameters are supported
- Only dense data is supported
* - `BasicStatistics`
- Supported data formats:
- Dense data
- CSR sparse matrices
- Sample weights **not** supported for CSR data format

.. _spmd-support:

Expand Down Expand Up @@ -408,6 +477,15 @@ Classification
- ``oob_score`` = `True`
- ``sample_weight`` != `None`
- Multi-output and sparse data are not supported
* - `ExtraTreesClassifier`
- All parameters are supported except:

- ``warm_start`` = `True`
- ``ccp_alpha`` != `0`
- ``criterion`` != `'gini'`
- ``oob_score`` = `True`
- ``sample_weight`` != `None`
- Multi-output and sparse data are not supported
* - `KNeighborsClassifier`
- All parameters are supported except:

Expand Down Expand Up @@ -445,6 +523,15 @@ Regression
- ``oob_score`` = `True`
- ``sample_weight`` != `None`
- Multi-output and sparse data are not supported
* - `ExtraTreesRegressor`
- All parameters are supported except:

- ``warm_start`` = `True`
- ``ccp_alpha`` != `0`
- ``criterion`` != `'mse'`
- ``oob_score`` = `True`
- ``sample_weight`` != `None`
- Multi-output and sparse data are not supported
* - `KNeighborsRegressor`
- All parameters are supported except:

Expand All @@ -455,8 +542,8 @@ Regression
* - `LinearRegression`
- All parameters are supported except:

- ``normalize`` != `False`
- ``sample_weight`` != `None`
- ``positive`` = `True`
- Only dense data is supported.

Clustering
Expand All @@ -473,10 +560,14 @@ Clustering
* - `KMeans`
- All parameters are supported except:

- ``precompute_distances``
- ``sample_weight`` != `None`
- ``Init`` = `'k-means++'` fallbacks to CPU.
- Sparse data is not supported
- ``algorithm`` != ``'lloyd'`` ('elkan' falls back to 'lloyd')
- ``n_clusters`` != ``1``
- ``sample_weight`` must be `None` for predict
- ``sample_weight`` must be `None` or all ones for fit
- ``init`` = `'k-means++'` fallbacks to CPU
- Supported data formats:
- Dense data
- CSR sparse matrices
* - `DBSCAN`
- All parameters are supported except:

Expand All @@ -498,8 +589,8 @@ Dimensionality Reduction
* - `PCA`
- All parameters are supported except:

- ``svd_solver`` not in [`'full'`, `'covariance_eigh'`]
- ``fit`` is the only method supported
- ``svd_solver`` not in [`'full'`, `'covariance_eigh'`, `'onedal_svd'`]
- For |sklearn| < 1.5: `'full'` solver is automatically mapped to `'covariance_eigh'`
- Sparse data is not supported

Nearest Neighbors
Expand Down Expand Up @@ -535,6 +626,11 @@ Other Tasks
* - `EmpiricalCovariance`
- All parameters are supported
- Only dense data is supported
* - `BasicStatistics`
- Supported data formats:
- Dense data
- CSR sparse matrices
- Sample weights **not** supported for CSR data format

Scikit-learn Tests
------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ class IncrementalBasicStatistics(oneDALEstimator, BaseEstimator):
Attribute exists only if corresponding result option has been provided.

Names of attributes without the trailing underscore are supported
currently but deprecated in 2025.1 and will be removed in 2026.0
currently but deprecated in 2025.1 and will be removed in 2026.0.

Sparse data formats are not supported. Input dtype must be ``float32`` or ``float64``.

%incremental_serialization_note%

Expand Down
4 changes: 4 additions & 0 deletions sklearnex/covariance/incremental_covariance.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ class IncrementalEmpiricalCovariance(oneDALEstimator, BaseEstimator):
n_features_in_ : int
Number of features seen during ``fit`` or ``partial_fit``.

Notes
-----
Sparse data formats are not supported. Input dtype must be ``float32`` or ``float64``.

%incremental_serialization_note%

Examples
Expand Down
4 changes: 4 additions & 0 deletions sklearnex/linear_model/incremental_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ class IncrementalLinearRegression(
n_features_in_ : int
Number of features seen during ``fit`` or ``partial_fit``.

Notes
-----
Sparse data formats are not supported. Input dtype must be ``float32`` or ``float64``.

%incremental_serialization_note%

Examples
Expand Down
4 changes: 4 additions & 0 deletions sklearnex/linear_model/incremental_ridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ class IncrementalRidge(MultiOutputMixin, RegressorMixin, oneDALEstimator, BaseEs

batch_size_ : int
Inferred batch size from ``batch_size``.

Notes
-----
Sparse data formats are not supported. Input dtype must be ``float32`` or ``float64``.

%incremental_serialization_note%
"""
Expand Down
Loading