cluster_sizes#
- er_evaluation.cluster_sizes(membership)[source]#
Compute the size of each cluster.
- Parameters:
membership (Series) – Membership vector representation of a clustering.
- Returns:
Series indexed by cluster identifier and with values corresponding to cluster size. Note that NA cluster identifiers are excluded.
- Return type:
Series
Examples
>>> membership = pd.Series(index=[1,2,3,4,5,6,7,8], data=[1,1,2,3,2,4,4,4]) >>> cluster_sizes(membership) 1 2 2 2 3 1 4 3 dtype: int64