-
-
Notifications
You must be signed in to change notification settings - Fork 25k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug fix for t-SNE (issue #3526) #3532
Conversation
Some of the pairwise distances do not support the additional `squared` parameter. I suggest using `sqeuclidian` and such whenever this is required.
As someone who doesn't know this code well: I assume with this change the default metric should be changed to "sqeuclidian". Perhaps Should the calls to |
I agree, default metric should then be `sqeuclidean' |
It's a little disturbing that tests succeed without that change. Could you change the default to |
When was the t-SNE code merged in anyway? Before or after 0.15? |
Oh, it's in 0.15... @jnothman The |
Well, shouldn't it be simple to implement sqeuclidean as a name for our On 8 August 2014 02:32, Lars Buitinck notifications@github.com wrote:
|
The name has already been discussed. We decided to use the name if self.metric == "euclidean":
distances = pairwise_distances(X, metric=self.metric, squared=True)
else:
distances = pairwise_distances(X, metric=self.metric) Or you can implement a Also you need to add a non-regression test (a test which shows that other metrics than the default one work as expected). |
Do you mean it's been decided that |
In We chose to do the same for consistency. In general, I don't think it would be useful to add Either way we need to choose one of the following three options:
|
|
Thanks @AlexanderFabisch https://github.com/AlexanderFabisch. Could you On 13 August 2014 19:13, Alexander Fabisch notifications@github.com wrote:
|
Did I miss something? |
Regarding the speed of |
Thanks, that makes sense. On 13 August 2014 21:22, Alexander Fabisch notifications@github.com wrote:
|
@makokal are you able to follow through with @mblondel's recommendation? |
A non-regression test would be appropriate too. |
+1 for a new test as well. |
@@ -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, squared=True) | |||
print("[t-SNE] Computing pairwise distances...")\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please remove the trailing \
.
Are you going to finish this @makokal or can I help you? |
@AlexanderFabisch Sorry been tied up much lately, you can go ahead a finish it up. Much appreciated |
I added a test and removed the trailing '' in https://github.com/AlexanderFabisch/scikit-learn/tree/makokal-master . Before I open another pull request: is everyone happy with this solution or should we find a different solution or should we document this in the docstring? |
Looks fine with me |
Superseded by #3786. Thanks! |
Some of the pairwise distances do not support the additional
squared
parameter. I suggest usingsqeuclidian
and such whenever this is required.