Skip to content

LinkPredAveragePopularity

LinkPredAveragePopularity(k: int, popularity: ArrayLike)

Bases: _LinkPredMetric

Average Recommendation Popularity @ \(k\): the average popularity of the recommended items.

Parameters:

Name Type Description Default
k int

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

required
popularity ArrayLike

The popularity of every item, e.g. its number of ratings in the training set.

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

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