@Shareable public class ItemMeanRatingItemScorer extends AbstractItemScorer implements java.io.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,
java.util.Collection<java.lang.Long> items)
Score a collection of items and potentially return more details on the scores.
|
java.lang.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 java.util.Collection<java.lang.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.public java.lang.String toString()
toString
in class java.lang.Object