Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC fix link to images in KMeans tutorial #24793

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

Merged
merged 6 commits into from
Nov 16, 2022

Conversation

glemaitre
Copy link
Member

@glemaitre glemaitre commented Oct 31, 2022

closes #24791

Adapt the tutorial on unsupervised learning based on recent changes in the examples from the gallery. There is also an additional fix on one of the examples where the titles of the subfigures are not the right ones.

@betatim
Copy link
Member

betatim commented Oct 31, 2022

Looking at the first figure in https://output.circle-artifacts.com/output/job/78625850-7089-4258-a7c1-53e974fd919e/artifacts/0/doc/tutorial/statistical_inference/unsupervised_learning.html:

image

I can't really work out how the "bad init" (bottom left) and "good" (top right) example are different. Certainly not why one is a case of bad initialisation and the other isn't. Both a very similar to each other and have a few mistakes compared to the ground truth. Is there a way to make it more obvious to the non-expert (like me) reader?

ground-truth (bottom right figure) and different clustering. We do not
recover the expected labels, either because the number of cluster was
chosen to be to large (top left figure) or suffer from a bad initialization
(top right figure).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"bottom left" and "top right" need swapping to match the labeling in the figure.


.. figure:: /auto_examples/cluster/images/sphx_glr_plot_face_compress_001.png
:target: ../../auto_examples/cluster/plot_face_compress.html

**Raw image**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This headline now gets "sucked into" the code example above. My rST foo is not strong enough to suggest a fix :(

@glemaitre
Copy link
Member Author

I can't really work out how the "bad init" (bottom left) and "good" (top right) example are different. Certainly not why one is a case of bad initialisation and the other isn't. Both a very similar to each other and have a few mistakes compared to the ground truth. Is there a way to make it more obvious to the non-expert (like me) reader?

I went back in the past to understand what we tried to show: https://scikit-learn.org/0.15/tutorial/statistical_inference/unsupervised_learning.html

I think the idea was to show that n_init=1 with random initialization can lead to a local optimum. However, either at this time, the bad initialization is not one to me. The labels are just switched.

What I would like is to have a working example at first, as we had in the past. Then, we can open an issue to improve the current example to trigger a "real" bad init. Not sure that iris would lead to such local minimum indeed :)

@betatim
Copy link
Member

betatim commented Oct 31, 2022

The text in plot_cluster_iris.py is wrong as well/doesn't match the order in the figure. Should I make a PR to fix it? Or will you do it here (might be easier because we have to keep the text in unsupervised_learning.rst and plot_cluster_iris.py in sync :-/

@glemaitre
Copy link
Member Author

I can do it here. It is a regression that I probably included in the last PR.

@jeremiedbb
Copy link
Member

I fixed the description in plot_iris. Let me know what you think.

Copy link
Member

@jeremiedbb jeremiedbb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @glemaitre

@jeremiedbb jeremiedbb merged commit 40748d1 into scikit-learn:main Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Example change produces warnings in documentation
3 participants