Python - hierarchical agglomerative clustering algorithm counting

Viewed 152

I need help on the following:

I am trying to work on code for this question:

Write a line of code that will display the number of articles that were assigned to each cluster by the hierarchical agglomerative clustering algorithm.

What I'm trying to figure out is how do I find the names of the clusters that were created by the hierarchical agglomerative clustering algorithm?

screenshot of code creating the clusters

1 Answers

Well, I found my answer. In case anyone needs to know it:

df['agglomerative_cluster_id'].value_counts()

It grouped the clusters together and summed them.

Related