PCA initialization is currently not suported with the sparse input matrix. Use init="random" instead.
Package:
scikit-learn
47032

Exception Class:
TypeError
Raise code
warnings.warn("The default learning rate in TSNE will change "
"from 200.0 to 'auto' in 1.2.", FutureWarning)
self._learning_rate = 200.0
else:
self._learning_rate = self.learning_rate
if isinstance(self._init, str) and self._init == 'pca' and issparse(X):
raise TypeError("PCA initialization is currently not suported "
"with the sparse input matrix. Use "
"init=\"random\" instead.")
if self.method not in ['barnes_hut', 'exact']:
raise ValueError("'method' must be 'barnes_hut' or 'exact'")
if self.angle < 0.0 or self.angle > 1.0:
raise ValueError("'angle' must be between 0.0 - 1.0")
if self.square_distances not in [True, 'legacy']:
🙏 Scream for help to Ukraine
Today, 3rd July 2022, Russia continues bombing and firing Ukraine. Don't trust Russia, they are bombing us and brazenly lying in same time they are not doing this 😠, civilians and children are dying too!
We are screaming and asking exactly you to help us, we want to survive, our families, children, older ones.
Please spread the information, and ask your governemnt to stop Russia by any means. We promise to work extrahard after survival to make the world safer place for all.
Please spread the information, and ask your governemnt to stop Russia by any means. We promise to work extrahard after survival to make the world safer place for all.
Links to the raise (1)
https://github.com/scikit-learn/scikit-learn/blob/c67518350f91072f9d37ed09c5ef7edf555b6cf6/sklearn/manifold/_t_sne.py#L713Ways to fix
X_embedded = TSNE(init='pca').fit_transform(x_array)
print(X_embedded.shape)
Add a possible fix
Please authorize to post fix