Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Cut a ClusteringTree graph at a given height and return the resulting clusters
ResourceFunction["ClusteringTreeClustersByHeight"][tree, h] gives the clusters in the ClusteringTree tree when cut at height h. |
Using given data, find the ClusteringTree:
In[1]:= | ![]() |
Out[2]= | ![]() |
Obtain a cluster hierarchy from the given tree:
In[3]:= | ![]() |
Out[3]= | ![]() |
Make a list of data:
In[4]:= | ![]() |
Compute the clustering tree:
In[5]:= | ![]() |
Out[5]= | ![]() |
Plot the dendrogram to help choose a height at which to cut the tree:
In[6]:= | ![]() |
Out[6]= | ![]() |
Compute the clusters at a height of 200:
In[7]:= | ![]() |
Out[7]= | ![]() |
Plot the locations of the cites colored by cluster:
In[8]:= | ![]() |
Out[8]= | ![]() |
Wolfram Language 13.0 (December 2021) or above
This work is licensed under a Creative Commons Attribution 4.0 International License