lenskit.metrics.ranking.ILS =========================== .. py:class:: lenskit.metrics.ranking.ILS(dataset, attribute, n = None) :canonical: lenskit.metrics.ranking._ils.ILS Bases: :py:obj:`lenskit.metrics.ranking._base.ListMetric`, :py:obj:`lenskit.metrics.ranking._base.RankingMetricBase` Evaluate recommendation diversity using intra-list similarity (ILS). This metric measures the average pairwise cosine similarity between item vectors in a recommendation list. Lower values indicate more diverse recommendations, while higher values indicate less diverse recommendations. :param dataset: The LensKit dataset containing item entities and their attributes. :param attribute: Name of the attribute or vector source (e.g., 'genre', 'tag'). :param n: Recommendation list length to evaluate. :Stability: Caller .. py:attribute:: attribute :type: str .. py:property:: label The metric's default label in output. The base implementation returns the class name by default. .. 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