lenskit.metrics.ranking.MeanPopRank =================================== .. py:class:: lenskit.metrics.ranking.MeanPopRank(data, *, n = None, k = None, count = 'users') :canonical: lenskit.metrics.ranking._pop.MeanPopRank Bases: :py:obj:`lenskit.metrics.ranking._base.ListMetric`, :py:obj:`lenskit.metrics.ranking._base.RankingMetricBase` Compute the _obscurity_ (mean popularity rank) of the recommendations. Unlike other metrics, this metric requires access to the training dataset in order to compute item popularity metrics. Supply this as a constructor parameter. This metric represents the popularity rank as a quantile, based on the either the number of distinct users who have interacted with the item, or the total interactions (depending on the options — distinct users is the default). Let $q_i$ be the _popularity rank_, represented as a quantile, of item $i$. $q_i = 1$ for the most-popular item; $q_i=0$ for an item with no users or interactions (the quantiles are min-max scaled). This metric computes the mean of the quantile popularity ranks for the recommended items: .. math:: \mathcal{M}(L) = \frac{1}{|L|} \sum_{i \in L} q_i This metric is based on the ``obscurity'' metric of :cite:t:`ekstrandSturgeonCoolKids2017` and the popularity-based item novelty metric of :cite:t:`vargasRankRelevanceNovelty2011`. :Stability: Caller .. py:attribute:: item_ranks :type: pandas.Series[float] .. py:method:: measure_list(recs, test) Compute measurements for a single list. :returns: - A float for simple metrics - Intermediate data for decomposed metrics - A dict mapping metric names to values for multi-metric classes