adjusted_rand_score#

er_evaluation.adjusted_rand_score(prediction, reference)[source]#

Compute the adjusted Rand index.

This wraps scikit-learn’s adjusted rand score function.

Parameters:
  • prediction (Series) – membership vector for predicted clusters, i.e. a pandas Series indexed by mention ids and with values representing predicted cluster assignment.

  • reference (Series) – membership vector for reference (true) clusters, i.e. a pandas Series indexed by mention ids and with values representing reference cluster assignment.

Returns:

adjusted rand index

Return type:

float

Notes

  • The prediction and reference membership vectors are inner joined before this metric is computed.

  • NA values are dropped from membership vectors prior to computing the metric.