number_of_links#
- er_evaluation.summary.number_of_links(membership)[source]#
Number of pairwise links associated with a given clustering.
- Parameters:
membership (Series) – Membership vector representation of a clustering.
- Returns:
Number of pairs of elements belonging to the same cluster. Note that clusters identified by NA values are excluded.
- Return type:
int
Examples
>>> membership = pd.Series(index=[1,2,3,4,5,6,7,8], data=[1,1,2,3,2,4,4,4]) >>> number_of_links(membership) 5.0