Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions daal4py/sklearn/manifold/_t_sne.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,15 @@ def _fit(self, X, skip_num_points=0):
daal_check_version((2021, "P", 600)),
"oneDAL version is lower than 2021.6.",
),
# Scikit-learn didn't support sparse PCA initialization before 1.8.
# This nevertheless offloads it to sklearn because it produces a different
# error message than what would be throws by simply passing the input to PCA.
(
not (
sklearn_check_version("1.8")
or not (
isinstance(self.init, str) and self.init == "pca" and issparse(X)
),
"PCA initialization is not supported with sparse input matrices.",
"PCA initialization is not supported with sparse input matrices before scikit-learn 1.8.",
),
# Note: these conditions below should result in errors, but stock scikit-learn
# does not check for errors at this exact point. Hence, this offloads the erroring
Expand Down
2 changes: 1 addition & 1 deletion doc/sources/algorithms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Dimensionality Reduction
- ``method`` != ``"barnes_hut"``

Refer to :ref:`TSNE acceleration details <acceleration_tsne>` to learn more.
- Sparse data with ``init`` = ``"pca"`` is not supported
- Sparse data is not supported for the initialization and distance calculation stages.

Nearest Neighbors
*****************
Expand Down
Loading