U - type of the usersI - type of the itemspublic class AverageRecommendationMetric<U,I> extends AbstractSystemMetric<U,I>
| Constructor and Description |
|---|
AverageRecommendationMetric(RecommendationMetric<U,I> metric,
boolean ignoreNaN)
Constructor in which the average is calculated for all the recommendations added during the calculation.
|
AverageRecommendationMetric(RecommendationMetric<U,I> metric,
int numUsers)
Constructor in which the number of users of the recommendation metric to be averaged is specified.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Recommendation<U,I> recommendation)
Add a recommendation to the metric.
|
double |
addAndEvaluate(Recommendation<U,I> recommendation)
Adds the recommendation metric to the average and returns the user value.
|
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.
|
void |
reset()
Resets the metric by discarding the recommendations previously added.
|
public AverageRecommendationMetric(RecommendationMetric<U,I> metric, int numUsers)
metric - recommendation metric to be averagednumUsers - number of expected users' recommendationspublic AverageRecommendationMetric(RecommendationMetric<U,I> metric, boolean ignoreNaN)
metric - recommendation metric to be averagedignoreNaN - ignore NaNs from the calculation of the average?public double addAndEvaluate(Recommendation<U,I> recommendation)
recommendation - recommendation to be addedpublic void add(Recommendation<U,I> recommendation)
SystemMetricrecommendation - recommendation to be added to the computation.public void combine(SystemMetric<U,I> other)
SystemMetricother - other system metric, should be of the same or compatible
classpublic double evaluate()
SystemMetricpublic void reset()
SystemMetricCopyright © 2016. All rights reserved.