-
-
Notifications
You must be signed in to change notification settings - Fork 26.4k
DOC Fix incorrect description in Classical MDS documentation #32576
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?
Conversation
|
I don't mind this edit, but please write "Gram matrix" with capital "G", because Gram is a name.
Well, your version may be more precise, but the current formulation is not incorrect. These matrices differ by a constant factor (-0.5), so they have the same eigenvectors. |
Thank you for pointing it out. This is fixed now. |
betatim
left a comment
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.
I'm not an expert on MDS but from doing a bit of reading I think that the suggestion from this PR makes it more precise what is going on and maybe also more familiar to readers who are experts on the topic.
It would be good to have the opinion of someone who is an expert on this topic. Just to make sure we are not missing some edge case or second order level of detail. Many things in scikit-learn are the way they are for a reason, even if that reason isn't obvious at first (of course there are also many things that should be improved :D).
doc/modules/manifold.rst
Outdated
| loss function with a different loss function called *strain*, which has an | ||
| exact solution in terms of eigendecomposition of the double-centered matrix | ||
| of squared dissimilarities. If the dissimilarity matrix consists of the pairwise | ||
| exact solution in terms of eigendecomposition of the Gram matrix. |
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.
I would rather write here simply "exact solution in terms of eigendecomposition", and delete "of the Gram matrix". At this point in the text the Gram matrix has not yet been introduced, so it may be confusing. The point of the sentence is rather to say that the solution in terms of EIG exists. The below we can explain what the Gram matrix is etc.
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.
Sounds fair. I'll update it.
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.
Done!
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.
Cool, this can be resolved.
|
I made the relationship between the Gram matrix and the loss function clearer. |
|
On a side note, should Classical MDS also be in a dropdown like Metric and Non-metric MDS? If so, I'll fix this. |
I think the first paragraph and the image should be outside of a dropdown, but you can put the paragraph below the figure (beginning with "Formally") into a dropdown if you like. |
Thanks for the suggestion. Since it seems like a stylistic choice, I'll leave it as is for now. |
|
This PR looks good to me now (as the author of the |
What does this implement/fix? Explain your changes.
The double-centered squared dissimilarity matrix is just$C\Delta C$ , and the gram matrix $B$ is $-\frac{1}{2}$ times that result. Classical MDS performs eigendecomposition on this gram matrix.
However, the documentation states that eigendecomposition is performed on the double-centered matrix of squared dissimilarities, which is incorrect.