I'm using agglomerative hierarchical clustering for news headlines clustering. But instead of having a flat cut through dendrogram for generating cluster, I want to use some other ways.
from scipy.cluster.hierarchy import fcluster, linkage, dendrogram
Z = linkage(np.array(distance_matrix), "average")
Z
array([[ 4235., 4296., 0., 2.],
[ 2867., 3004., 0., 2.],
[ 3220., 3368., 0., 2.],
...,
[ 6227., 14207., 1., 12.],
[12355., 14208., 1., 14.],
[14197., 14209., 1., 7106.]])
At every any step(i) cluster Z[i,0] merges with cluster Z[i,1] and a new cluster is created as C. where C = n+i
n = total number of points
i = step(every merge is a step first merge is step 0)
how to get the original member(point in the cluster) of the cluster C?Is there a scipy function for this.