public class UserMeanItemScorer extends AbstractItemScorer
Rating scorer that returns the user’s average rating for all predictions.
This scorer does not directly average the user’s ratings; rather, it averages their offsets from the scores produced by another scorer (the UserMeanBaseline). If this is the GlobalMeanRatingItemScorer (the default), then this is a straight user mean item scorer with damping; reconfigure it to use ItemMeanRatingItemScorer as the baseline to get a user-item personalized mean.
This is why it is not called a mean rating item scorer; it can compute the mean of any kind of user-based score.
| Constructor and Description |
|---|
UserMeanItemScorer(RatingVectorPDAO rv,
ItemScorer base,
double damp)
Construct a scorer that computes user means offset by the global mean.
|
| 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 UserMeanItemScorer(RatingVectorPDAO rv, @UserMeanBaseline ItemScorer base, @MeanDamping double damp)
Construct a scorer that computes user means offset by the global mean.
rv - The DAO to get user rating vectors.base - An item scorer that provides the baseline scores.damp - A damping term for the calculations.@Nonnull public ResultMap scoreWithDetails(long user, @Nonnull java.util.Collection<java.lang.Long> items)
ItemScorerScore a collection of items and potentially return more details on the scores.
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