diff --git a/daal4py/sklearn/manifold/_t_sne.py b/daal4py/sklearn/manifold/_t_sne.py index 88d964e1fa..1971f01fc9 100755 --- a/daal4py/sklearn/manifold/_t_sne.py +++ b/daal4py/sklearn/manifold/_t_sne.py @@ -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 diff --git a/doc/sources/algorithms.rst b/doc/sources/algorithms.rst index d287ec56f8..ea3b33718e 100755 --- a/doc/sources/algorithms.rst +++ b/doc/sources/algorithms.rst @@ -196,7 +196,7 @@ Dimensionality Reduction - ``method`` != ``"barnes_hut"`` Refer to :ref:`TSNE acceleration details ` 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 *****************