Evaluation

LibAM offers a small set of metrics for alignment quality. Accuracy can be used when the ground truth between the aligned graphs is known. When it is not, Frobenius offers an alternative based purely on how well the matched structure overlaps.

These evaluation functions are largely meant for learning your way around the library, and are not built to scale to larger datasets. They exist as a small set of tools to test alignments.

The primary metrics take a GraphPair and the resulting similarity matrix P, found by executing an alignment algorithm.

Primary

libam.evaluation.evaluation.accuracy(pair: GraphPair, p: ndarray) float[source]
libam.evaluation.evaluation.frobenius(pair: GraphPair, P: ndarray) float[source]

Squared Frobenius distance between the matched adjacency submatrices.

Lower is better, and requires no ground truth. The value scales with graph size, so it is only comparable across alignments of the same pair.

Parameters:
  • pair – Graph pair (ground truth not required).

  • P – Similarity matrix of shape [n_src, n_tar].