U
- type of the usersI
- type of the itemspublic abstract class AbstractSalesDiversityMetric<U,I> extends AbstractSystemMetric<U,I>
Modifier and Type | Field and Description |
---|---|
protected int |
cutoff
maximum length of the recommendation lists that is evaluated
|
protected double |
freeNorm
Norm for free discovery item novelty models.
|
protected it.unimi.dsi.fastutil.objects.Object2DoubleOpenHashMap<I> |
itemCount
Map of item-count.
|
protected it.unimi.dsi.fastutil.objects.Object2DoubleOpenHashMap<I> |
itemWeight
Map of item-weight.
|
protected int |
numUsers
Number of users.
|
Constructor and Description |
---|
AbstractSalesDiversityMetric(int cutoff,
RankingDiscountModel disc,
RelevanceModel<U,I> rel)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
add(Recommendation<U,I> recommendation)
Add a recommendation to the metric.
|
void |
combine(SystemMetric<U,I> other)
Combines the recommendations added to other system metric to this one.
|
double |
evaluate()
Evaluates the metric for the recommendations added so far.
|
protected abstract double |
nov(I i)
Returns the sales novelty of an item.
|
void |
reset()
Resets the metric by discarding the recommendations previously added.
|
protected final int cutoff
protected final it.unimi.dsi.fastutil.objects.Object2DoubleOpenHashMap<I> itemCount
protected final it.unimi.dsi.fastutil.objects.Object2DoubleOpenHashMap<I> itemWeight
protected double freeNorm
protected int numUsers
public AbstractSalesDiversityMetric(int cutoff, RankingDiscountModel disc, RelevanceModel<U,I> rel)
cutoff
- maximum length of the recommendation lists that is evaluateddisc
- ranking discount modelrel
- relevance modelpublic void add(Recommendation<U,I> recommendation)
SystemMetric
recommendation
- recommendation to be added to the computation.public void combine(SystemMetric<U,I> other)
SystemMetric
other
- other system metric, should be of the same or compatible
classprotected abstract double nov(I i)
i
- itempublic double evaluate()
SystemMetric
public void reset()
SystemMetric
Copyright © 2016. All rights reserved.