@Shareable public class ItemMeanRatingItemScorer extends AbstractItemScorer implements Serializable
Rating scorer that returns the item’s mean rating for all predictions.
If the item has no ratings, the global mean rating is returned.
This implements the baseline scorer (p_{u,i} = \mu + b_i), where (b_i) is the item’s average rating (less the global mean (\mu)).
Constructor and Description |
---|
ItemMeanRatingItemScorer(RatingSummary summary,
double damping)
Construct a new scorer.
|
Modifier and Type | Method and Description |
---|---|
ResultMap |
scoreWithDetails(long user,
Collection<Long> items)
Score a collection of items and potentially return more details on the scores.
|
String |
toString() |
score, score
@Inject public ItemMeanRatingItemScorer(RatingSummary summary, @MeanDamping double damping)
Construct a new scorer. This assumes ownership of the provided map.
summary
- The rating summary.damping
- The damping factor.@Nonnull public ResultMap scoreWithDetails(long user, @Nonnull Collection<Long> items)
ItemScorer
Score a collection of items and potentially return more details on the scores.
scoreWithDetails
in interface ItemScorer
user
- The user ID for whom to generate scores.items
- The item to score.ResultMap
that provides access to those details.