@Shareable public class PopularityRankItemScorer extends AbstractItemScorer implements java.io.Serializable
Item scorer scores items based on their popularity rank. 1 is the most popular item, and 0 is an unknown item.
Constructor and Description |
---|
PopularityRankItemScorer(InteractionStatistics stats) |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.Long,java.lang.Double> |
score(long user,
java.util.Collection<java.lang.Long> items)
Score a collection of items.
|
ResultMap |
scoreWithDetails(long user,
java.util.Collection<java.lang.Long> items)
Score a collection of items and potentially return more details on the scores.
|
score
@Inject public PopularityRankItemScorer(InteractionStatistics stats)
@Nonnull public java.util.Map<java.lang.Long,java.lang.Double> score(long user, @Nonnull java.util.Collection<java.lang.Long> items)
AbstractItemScorer
Score a collection of items.
This implementation delegates to ItemScorer.scoreWithDetails(long, Collection)
.
score
in interface ItemScorer
score
in class AbstractItemScorer
user
- The user ID for whom to generate scores.items
- The item to score.@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.