@DefaultImplementation(value=WeightedAverageNeighborhoodScorer.class) public interface NeighborhoodScorer
This interface encapsulates aggregating user scores and item similarities into a final score. The neighborhood is pre-filtered to only contain items for which scores are available, and truncated to the neighborhood size, so all functions implementing this interface need to do is accumulate scores.
Modifier and Type | Method and Description |
---|---|
ScoredId |
score(long item,
SparseVector neighbors,
SparseVector scores)
Compute a score based on similar neighbors and their corresponding
scores.
|
ScoredId score(long item, SparseVector neighbors, SparseVector scores)
item
- neighbors
- A vector of neighbors with similarity measures.scores
- A vector of item scores. It should contain a score for
every item in neighbors.null
if
no score could be computed.