lenskit.metrics.ranking.ListGini#
- class lenskit.metrics.ranking.ListGini(n=None, *, k=None, items)#
Bases:
GiniBaseMeasure item diversity of recommendations with the Gini coefficient.
This computes the Gini coefficient of the number of lists that each item appears in.
- Parameters:
n (int | None) – The maximum recommendation list length.
items (lenskit.data.Vocabulary | lenskit.data.Dataset) – The item vocabulary or a dataset from which to extract the items.
k (int | None)
- Stability:
- Caller (see Stability Levels).
- 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: