I have a precomputed distance matrix.
I'm trying to do an hierarchical clustering using scipy:
from scipy.cluster.hierarchy import fcluster, linkage, cut_tree,fcluster
z = linkage(ds, "average")
clust = fcluster(z, 4, criterion='maxclust')
print(clust)
The problem is that, most of the labels ends up in one group - Why?
By the way, I tried to use AgglomerativeClustering
as well but I got similar results.
ds
is the precomputed distance matrix. I'm using DTW, a distance metric for time series analysis.
I uploaded ds.csv
to here.
Also, here's an heatmap which forms interesting lines (I don't really know how to interpret this currently)