Skip to content

LinkPredCoverage

LinkPredCoverage(k: int, num_dst_nodes: int)

Bases: _LinkPredMetric

Coverage @ \(k\): the proportion of the destination nodes that appear in at least one top-\(k\) recommendation.

Parameters:

Name Type Description Default
k int

The number of top-\(k\) predictions to evaluate against.

required
num_dst_nodes int

The total number of destination nodes.

required
Source code in mlx_graphs/metrics/link_pred.py
def __init__(self, k: int, num_dst_nodes: int):
    self.num_dst_nodes = num_dst_nodes
    super().__init__(k)

from mlx_graphs.metrics import LinkPredCoverage · mlx_graphs/metrics/link_pred.py