Skip to content

Commit 0ea65bb

Browse files
committed
FIX better RandomizedPCA sparse deprecation
1 parent 7a9ad10 commit 0ea65bb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sklearn/decomposition/pca.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -664,9 +664,10 @@ def _fit(self, X):
664664
"""
665665
random_state = check_random_state(self.random_state)
666666
if sparse.issparse(X):
667-
warnings.warn("Sparse matrix support is deprecated"
668-
" and will be dropped in 0.16."
669-
" Use TruncatedSVD instead.",
667+
warnings.warn("Sparse matrix support is deprecated in 0.15"
668+
" and will be dropped in 0.17. In particular"
669+
" computed explained variance is incorrect on"
670+
" sparse data. Use TruncatedSVD instead.",
670671
DeprecationWarning)
671672
else:
672673
# not a sparse matrix, ensure this is a 2D array

0 commit comments

Comments
 (0)