matching_rate#
- er_evaluation.summary.matching_rate(membership)[source]#
Compute the matching rate for a given clustering.
- Matching rate:
This is the proportion of elements belonging to clusters of size at least 2.
- 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]) >>> matching_rate(membership) 0.875