From the sklearn RandomizedPCA documentation , sparse matrices are accepted as input. However, when I called it sparse matrix, I got a TypeError :
> sklearn.__version__ '0.16.1' > pca = RandomizedPCA(n_components=2) > pca.fit(my_sparce_mat) TypeError: A sparse matrix was passed, but dense data is required. Use X.toarray() to convert to a dense numpy array.
I got the same error using fit_transform .
Any suggestion on how to make it work?
source share