public class ItemItemItemBasedItemScorer extends AbstractItemBasedItemScorer
Score items based on the basket of items using an item-item CF model.
Modifier and Type | Field and Description |
---|---|
protected ItemItemModel |
model |
protected NeighborhoodScorer |
scorer |
Constructor and Description |
---|
ItemItemItemBasedItemScorer(ItemItemModel m,
int nnbrs) |
Modifier and Type | Method and Description |
---|---|
protected void |
scoreItem(Long2DoubleMap scores,
long item,
ItemItemScoreAccumulator accum)
Score a single item into an accumulator.
|
java.util.Map<java.lang.Long,java.lang.Double> |
scoreRelatedItems(java.util.Collection<java.lang.Long> basket,
java.util.Collection<java.lang.Long> items)
Score a collection of items based on a collection of items (e.g.
|
ResultMap |
scoreRelatedItemsWithDetails(java.util.Collection<java.lang.Long> basket,
java.util.Collection<java.lang.Long> items)
Score a collection of items based on a collection of items (e.g.
|
scoreRelatedItem
protected final ItemItemModel model
@Nonnull protected final NeighborhoodScorer scorer
@Inject public ItemItemItemBasedItemScorer(ItemItemModel m, @NeighborhoodSize int nnbrs)
@Nonnull public java.util.Map<java.lang.Long,java.lang.Double> scoreRelatedItems(@Nonnull java.util.Collection<java.lang.Long> basket, @Nonnull java.util.Collection<java.lang.Long> items)
AbstractItemBasedItemScorer
Score a collection of items based on a collection of items (e.g. a shopping basket).
This implementation delegates to ItemBasedItemScorer.scoreRelatedItemsWithDetails(Collection, Collection)
.
scoreRelatedItems
in interface ItemBasedItemScorer
scoreRelatedItems
in class AbstractItemBasedItemScorer
basket
- The objective items ID used as the queryitems
- The list of items to score.public ResultMap scoreRelatedItemsWithDetails(@Nonnull java.util.Collection<java.lang.Long> basket, java.util.Collection<java.lang.Long> items)
ItemBasedItemScorer
Score a collection of items based on a collection of items (e.g. a shopping basket), with details.
basket
- The items to use as the query.items
- The items to score.Result
.protected void scoreItem(Long2DoubleMap scores, long item, ItemItemScoreAccumulator accum)
Score a single item into an accumulator.
scores
- The reference scores.item
- The item to score.accum
- The accumulator.