reconstruction_auc

reconstruction_auc(coordinates, graph: Graph, dist=False, max_samples=1000000)[source]

Compute the network reconstruction auc score

Parameters:
  • coordinates (torch.tensor) – embedding to evaluate

  • graph – network data

  • dist – if True, use distance decoder to evaluate embedding, otherwise use inner-product decoder (default: False)

  • max_samples – maximum number of edges to use for evaluation. If graph has less than max_samples edges, all edges are used as positive examples, otherwise, max_samples edges are sampled with replacement. In both cases, the number of negative samples is the same as positive samples.

Returns:

ROC-AUC for correctly classifying true edges versus non-edges

By default the function samples the same number of non-edges as there are true edges, such that a score of 0.5 corresponds to random classification.