How do I visualize the hierarchy formed by the agglomerative clustering as a dendogram. I have a precomputed distance matrix of size (400,400).
clusterer= AgglomerativeClustering(n_clusters=32,affinity="precomputed",linkage="average").fit(distance_matrix)
How do I clearly visualize the result that formed the 32 clusters as a dendogram? I tried visualizing the clusters but since they are 32, the colors were not clearly differentiating them apart.
colors_clusters = clusterer.labels_
fig = plt.figure(figsize=(10,7))
plt.xlabel('median_score', family='Arial', fontsize=9)
plt.ylabel('count_intersections', family='Arial', fontsize=9)
plt.title('Heliopolis', family='Arial', fontsize=12)
plt.scatter(clusters_df['median_score'], clusters_df['count_intersections'], c=colors_clusters, edgecolors='black', s=50)
plt.show()
