Diversity

Elliot integrates the following diversity metrics.

Summary

gini_index.gini_index.GiniIndex(…)

Gini Index

shannon_entropy.shannon_entropy.ShannonEntropy(…)

Shannon Entropy

SRecall.srecall.SRecall(recommendations, …)

Subtopic Recall

Gini Index

class elliot.evaluation.metrics.diversity.gini_index.gini_index.GiniIndex(recommendations, config, params, eval_objects)[source]

Bases: elliot.evaluation.metrics.base_metric.BaseMetric

Gini Index

This class represents the implementation of the Gini Index recommendation metric.

For further details, please refer to the book

\[\mathrm {GiniIndex}=\frac{1}{n-1} \sum_{j=1}^{n}(2 j-n-1) p\left(i_{j}\right)\]

\(i_{j}\) is the list of items ordered according to increasing p(i)

To compute the metric, add it to the config file adopting the following pattern:

simple_metrics: [Gini]

Shannon Entropy

class elliot.evaluation.metrics.diversity.shannon_entropy.shannon_entropy.ShannonEntropy(recommendations, config, params, eval_objects)[source]

Bases: elliot.evaluation.metrics.base_metric.BaseMetric

Shannon Entropy

This class represents the implementation of the Shannon Entropy recommendation metric.

For further details, please refer to the book

\[\mathrm {ShannonEntropy}=-\sum_{i=1}^{n} p(i) \log p(i)\]

To compute the metric, add it to the config file adopting the following pattern:

simple_metrics: [SEntropy]

SRecall

class elliot.evaluation.metrics.diversity.SRecall.srecall.SRecall(recommendations, config, params, eval_objects, additional_data)[source]

Bases: elliot.evaluation.metrics.base_metric.BaseMetric

Subtopic Recall

This class represents the implementation of the Subtopic Recall (S-Recall) recommendation metric.

For further details, please refer to the paper

\[\mathrm {SRecall}=\frac{\left|\cup_{i=1}^{K} {subtopics}\left(d_{i}\right)\right|}{n_{A}}\]

To compute the metric, add it to the config file adopting the following pattern:

simple_metrics: [SRecall]