Skip to content

MRG Make MDS compute proximity from input - #1452

Closed
amueller wants to merge 5 commits into
scikit-learn:masterfrom
amueller:mds_proximity
Closed

amueller wants to merge 5 commits into
scikit-learn:masterfrom
amueller:mds_proximity

Conversation

@amueller

@amueller amueller commented Dec 8, 2012

Copy link
Copy Markdown
Member

This introduces a new parameter to MDS and changes the default behaviour, as I did it before in the "precomputed" PR.
What are other proximities that can be used? I only saw examples with euclidean distances.

I used the name proximity as it was used in the docstring before.
I don't like the name proximity for two reasons:

  1. It's not used anywhere else
  2. it is misleading imho. A distance is passed, so a high value means "far apart". A high proximity means close together, right?

Should I rename it into "distance?" do we have any other algorithms that take dissimilarties?

@NelleV could you please have a look and voice your opinion? Thanks.
I didn't adjust the tests yet as I first wanted to get some feedback.

Closes #1390.

@GaelVaroquaux

Copy link
Copy Markdown
Member

@Varoquaux could you please have a look and voice your opinion? Thanks.

Which Varoquaux: Nelle (@NelleV) or myself?

:)

@amueller

amueller commented Dec 8, 2012

Copy link
Copy Markdown
Member Author

Sorry, I meant to ping Nelle (corrected). You are obviously welcome to voice your opinion, too ;)

@GaelVaroquaux

Copy link
Copy Markdown
Member

Sorry, I meant to ping Nelle (corrected).

I thought so. She is at NIPS right now, so give her a bit of time.

You are obviously welcome to voice your opinion, too ;)

Hers is probably more relevant than mine.

@NelleV

NelleV commented Dec 8, 2012

Copy link
Copy Markdown
Member

It looks OK to me, but I don't see the point in using MDS when you have the features and you can compute the whole similarity matrix: in this case, it is much faster to use SVD directly, and not MDS.

@GaelVaroquaux

Copy link
Copy Markdown
Member

It looks OK to me, but I don't see the point in using MDS when you have the
features and you can compute the whole similarity matrix: in this case, it is
much faster to use SVD directly, and not MDS.

The MDS should fall back to an SVD is such situation. Right now it is
inefficient for no good reason. People that want to perform an MDS on
their data shouldn't have to know that it boils down to an SVD if all the
distances are measured.

@NelleV

NelleV commented Dec 8, 2012

Copy link
Copy Markdown
Member

I'll open a ticket and work on a PR on my flight back to France.

@GaelVaroquaux

Copy link
Copy Markdown
Member

I'll open a ticket and work on a PR on my flight back to France.

Awesome. Thanks!

@amueller

amueller commented Dec 8, 2012

Copy link
Copy Markdown
Member Author

Huh, ok. The non-metric does make sense, doesn't it?
Sorry, I'm really not so familiar with MDS.

Thanks for volunteering to work on a PR @NelleV :)

@amueller

amueller commented Dec 8, 2012

Copy link
Copy Markdown
Member Author

Should I say something in the docs that MDS is only really helpful if you have a proximity matrix and not with features?

@GaelVaroquaux

Copy link
Copy Markdown
Member

Should I say something in the docs that MDS is only really helpful if you have
a proximity matrix and not with features?

It is mainly useful to go from a dataset characterised by a non-euclidian
distance to a euclidian description.

@amueller

amueller commented Dec 8, 2012

Copy link
Copy Markdown
Member Author

Hm that means most of the examples we have are basically useless / irrelevant because it is just PCA, right? hm...

@GaelVaroquaux

Copy link
Copy Markdown
Member

Hm that means most of the examples we have are basically useless / irrelevant
because it is just PCA, right? hm...

Almost. It's an eigen value problem on the squared distance matrix.

@amueller

amueller commented Dec 9, 2012

Copy link
Copy Markdown
Member Author

So what is the difference? I vaguely remember ESL saying it is the same.

@NelleV

NelleV commented Dec 9, 2012

Copy link
Copy Markdown
Member

I need this to be merged before working on #1453

@amueller

amueller commented Dec 9, 2012

Copy link
Copy Markdown
Member Author

@NelleV What are your thoughts on the name proximity? (see my reasoning above)

@ogrisel

ogrisel commented Dec 16, 2012

Copy link
Copy Markdown
Member

+1 for renaming proximity to metric or something that does not imply that neighbors have small values in this matrix (which is not the case for euclidean_distances as noted by @amueller ).

@amueller

Copy link
Copy Markdown
Member Author

Yeah, I also thought about metric. Though it doesn't need to be a metric, right? Maybe dissimilarity? distance?

@ogrisel

ogrisel commented Dec 16, 2012

Copy link
Copy Markdown
Member

The MDS should fall back to an SVD is such situation. Right now it is
inefficient for no good reason. People that want to perform an MDS on
their data shouldn't have to know that it boils down to an SVD if all the
distances are measured.

+1 I did not know about that. The documentation should make this more explicit:

http://scikit-learn.org/dev/modules/manifold.html#multi-dimensional-scaling-mds

@ogrisel

ogrisel commented Dec 16, 2012

Copy link
Copy Markdown
Member

@ogrisel

ogrisel commented Dec 16, 2012

Copy link
Copy Markdown
Member

Indeed the "metric" word is problematic for MDS as there is explicitly a "non-metric" mode. dissimilarity is fine to me.

@amueller

Copy link
Copy Markdown
Member Author

I'll make the button green in a second. Should I merge then?

@amueller

amueller commented Jan 5, 2013

Copy link
Copy Markdown
Member Author

ping?

@agramfort

Copy link
Copy Markdown
Member

LGTM

@GaelVaroquaux

Copy link
Copy Markdown
Member

LGTM 👍 for merge

@amueller

amueller commented Jan 7, 2013

Copy link
Copy Markdown
Member Author

thanks for the reviews.

@amueller

amueller commented Jan 7, 2013

Copy link
Copy Markdown
Member Author

Merged by rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MDS takes proximity matrix as input

5 participants