-
-
Notifications
You must be signed in to change notification settings - Fork 26k
FEA Implement classical MDS #31322
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
base: main
Are you sure you want to change the base?
FEA Implement classical MDS #31322
Conversation
Pinging @antoinebaker for a review :-) I have been doing some updates to this PR but am now finished with it. |
Thanks for the PR @dkobak ! Could you maybe use this PR to implement ClassicalMDS only, and do the enhancements of MDS in a separate / follow up PR ? It will ease the reviewing / merging process I think. |
All right. I took all changes to the |
Could you please add scikit-learn/sklearn/utils/_test_common/instance_generator.py Lines 185 to 187 in 4493f86
Then it will be tested for common checks on estimators in |
Hi @antoinebaker. I think the |
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.
Here a first round of reviews
Ah my bad, I think you're right. If |
doc/whats_new/upcoming_changes/sklearn.manifold/31322.feature.rst
Outdated
Show resolved
Hide resolved
I'm not sure if we discussed this, but I favor this comment (#22330 (comment)) (except the default value) as an overall API, instead of introducing a new class. Any blockers for doing so? |
@adrinjalali: Yes, we did discuss it. Just below the comment you linked to, @antoinebaker gave detailed reasons for why he prefers a separate class, please see here: #22330 (comment). He convinced me, and you wrote "I'm happy with the suggestions here" (#22330 (comment)), which is why I implemented a separate class... |
Hmm. Yeah fair enough. Just to avoid future surprises, maybe @lorentzenchr @GaelVaroquaux could also give their opinion? |
The TLDR of #22330 (comment) is that EDIT: removed outdated comment. |
Fixes #15272. Supersedes #22330.
This PR implements classical MDS, also known as principal coordinates analysis (PCoA) or Torgerson's scaling, see https://en.wikipedia.org/wiki/Multidimensional_scaling#Classical_multidimensional_scaling. As discussed in #22330, it is implemented as a new class
ClassicalMDS
.Simple demonstration:
Classical MDS is also set as default initialization for metric/non-metric MDS in theMDS()
class.For consistency, this PR also adds support for non-Euclidean metrics to theMDS
class.