Diversity¶
Diversity metrics evaluate the variety of items within a user's recommendations or across the recommendations for a set of users. These metrics are crucial for preventing "filter bubbles" and ensuring that users are exposed to a broad range of items, potentially increasing serendipity and user satisfaction.
API Reference
For class signatures and source code, see the Diversity Metrics API Reference.
Gini¶
Gini Index. Measures the inequality in the distribution of recommended items; lower values indicate more equitable item exposure.
where \(c_j\) is the recommendation count for item \(j\) (sorted in ascending order).
For further details, please refer to this book.
ShannonEntropy¶
Shannon Entropy. Quantifies the diversity of recommended items using information entropy; higher values reflect greater item variety.
For further details, please refer to this book.
SRecall¶
Subtopic Recall (SRecall@K). Measures how many distinct subtopics or categories are covered in the recommendations compared to the relevant ones, which reflects diversity across semantic dimensions.
Note
This metric requires the user to provide side information (e.g., item categories).
For further details, please refer to this paper.