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.
|
Map<Long,Double> |
scoreRelatedItems(Collection<Long> basket,
Collection<Long> items)
Score a collection of items based on a collection of items (e.g.
|
ResultMap |
scoreRelatedItemsWithDetails(Collection<Long> basket,
Collection<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 Map<Long,Double> scoreRelatedItems(@Nonnull Collection<Long> basket, @Nonnull Collection<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 Collection<Long> basket, Collection<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.