I have a question related to hierarchy clustering. I have a relative complex data sets with 2000 items/samples. I cluster the items using scipy and give the clusters different cutoff e.g. from 0.1 -0.9
from scipy.cluster import hierarchy as hac
Z=hac.linkage(distance, single,'euclidean')
results=hac.fcluster(Z, cutoff,'distance')
how can I check/track a certain item say when cutoff is 0.1 in group x, and when the cutoff is 0.2 is in group y. etc
I considered about showing the dendrogram ,but to track 1 item in 2000 samples from a dendrogram would be too messy?
Try to build a set of Clusters IDs using
set(list(..))
to remove duplicates, then go through the elements and filter your data depends on the cluster where they belong. Give it a try, as you didn't give a sample of data to test it.Your code would look like: