-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
DOC add link to cluster_plot_ward_structured_vs_unstructured in _aggl… #30861
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?
DOC add link to cluster_plot_ward_structured_vs_unstructured in _aggl… #30861
Conversation
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.
That looks good, thank you @mahmadza.
Basically, the examples are so similar, that we might want to join them later. But for now, I would merge this PR, since it is better to hint users to both usage examples than to only one, even if they don't differ so much.
@adrinjalali, what do you think about this?
They're almost the same example. I'd merge them in this PR. Would you be up for it @mahmadza ? You'd need to remove Line 438 in 6a2472f
And remove all mentions of the old example from the codebase. |
Sure I can do that. To summarize what I need to do:
Let me know if my understanding is correct. |
…ctured_vs_unstructured
…d_vs_unstructured.py
…lot_ward_structured_vs_unstructured
@StefanieSenger @adrinjalali All requested changes have been completed. |
from sklearn.cluster import AgglomerativeClustering | ||
from sklearn.datasets import make_swiss_roll | ||
from sklearn.neighbors import kneighbors_graph |
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.
in our (modern) examples, we tend to have the imports in the same cell that they're first used, instead of having them all on top of the file.
# Compute clustering without connectivity constraints | ||
# -------------------------------------------------- |
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.
# Compute clustering without connectivity constraints | |
# -------------------------------------------------- | |
# Compute clustering without connectivity constraints | |
# --------------------------------------------------- |
They need to be of the same length
.. image:: ../auto_examples/cluster/images/sphx_glr_plot_agglomerative_clustering_001.png | ||
:target: ../auto_examples/cluster/plot_agglomerative_clustering.html | ||
.. image:: ../auto_examples/cluster/images/sphx_glr_plot_ward_structured_vs_unstructured_001.png | ||
:target: ../auto_examples/cluster/plot_ward_structured_vs_unstructured.html | ||
:scale: 38 | ||
|
||
.. image:: ../auto_examples/cluster/images/sphx_glr_plot_agglomerative_clustering_002.png | ||
:target: ../auto_examples/cluster/plot_agglomerative_clustering.html | ||
:scale: 38 | ||
|
||
.. image:: ../auto_examples/cluster/images/sphx_glr_plot_agglomerative_clustering_003.png | ||
:target: ../auto_examples/cluster/plot_agglomerative_clustering.html | ||
:scale: 38 | ||
|
||
.. image:: ../auto_examples/cluster/images/sphx_glr_plot_agglomerative_clustering_004.png | ||
:target: ../auto_examples/cluster/plot_agglomerative_clustering.html | ||
.. image:: ../auto_examples/cluster/images/sphx_glr_plot_ward_structured_vs_unstructured_002.png | ||
:target: ../auto_examples/cluster/plot_ward_structured_vs_unstructured.html |
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.
This part of the diff is sort of a regression in the docs.
Before the change, this is how it looks:
and after, it looks like this:
The "before" is much clearer and shows the intent of the warning very nicely. We should make sure the new example covers the topic and that the linked pictures also show the intent of the warning.
Hi @mahmadza, would you like to continue working on this pull request? |
@adrinjalali @marenwestermann sorry for the delay. |
Reference Issues/PRs
Towards #30621
What does this implement/fix? Explain your changes.
Added a link to structured vs unstructured ward hierarchical clustering example in
AgglomerativeClustering
class.