lenskit.metrics.ranking.ExposureGini#

class lenskit.metrics.ranking.ExposureGini(n=None, *, k=None, items, weight=GeometricRankWeight())#

Bases: GiniBase

Measure exposure distribution of recommendations with the Gini coefficient.

This uses a weighting model to compute the exposure of each item in each list, and computes the Gini coefficient of the total exposure.

Parameters:
Stability:
Caller (see Stability Levels).
weight: lenskit.metrics.ranking._weighting.RankWeight#
measure_list(output, 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

Parameters:

output (lenskit.data.ItemList)

Return type:

tuple[numpy.typing.NDArray[numpy.int32], numpy.typing.NDArray[numpy.float64]]