Skip to content

Commit

Permalink
bug fix for t-SNE (issue scikit-learn#3526) with new inputs
Browse files Browse the repository at this point in the history
New fix following the discussion on the previous pull request. Thanks to @jnothman,  @mblondel and others ..
  • Loading branch information
makokal authored and AlexanderFabisch committed Oct 20, 2014
1 parent 0bdaecd commit e324fdd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sklearn/manifold/t_sne.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 431,12 @@ def _fit(self, X):
distances = X
else:
if self.verbose:
print("[t-SNE] Computing pairwise distances...")
distances = pairwise_distances(X, metric=self.metric)
print("[t-SNE] Computing pairwise distances...")\

if self.metric == "euclidean":
distances = pairwise_distances(X, metric=self.metric, squared=True)
else:
distances = pairwise_distances(X, metric=self.metric)

# Degrees of freedom of the Student's t-distribution. The suggestion
# alpha = n_components - 1 comes from "Learning a Parametric Embedding
Expand Down

0 comments on commit e324fdd

Please sign in to comment.