public class UserUserItemScorer extends AbstractItemScorer
Score items with user-user collaborative filtering.
The detailed results returned by this scorer are of type UserUserResult
.
Modifier and Type | Field and Description |
---|---|
protected NeighborFinder |
neighborFinder |
protected UserVectorNormalizer |
normalizer |
Constructor and Description |
---|
UserUserItemScorer(RatingVectorPDAO rvd,
NeighborFinder nf,
UserVectorNormalizer norm,
UserNeighborhoodScorer scorer,
int nnbrs) |
Modifier and Type | Method and Description |
---|---|
protected Long2ObjectMap<java.util.List<Neighbor>> |
findNeighbors(long user,
LongSet items)
Find the neighbors for a user with respect to 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, score
protected final NeighborFinder neighborFinder
protected final UserVectorNormalizer normalizer
@Inject public UserUserItemScorer(RatingVectorPDAO rvd, NeighborFinder nf, UserVectorNormalizer norm, UserNeighborhoodScorer scorer, @NeighborhoodSize int nnbrs)
@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.
user
- The user ID for whom to generate scores.items
- The item to score.ResultMap
that provides access to those details.protected Long2ObjectMap<java.util.List<Neighbor>> findNeighbors(long user, @Nonnull LongSet items)
Find the neighbors for a user with respect to a collection of items. For each item, the neighborhoodSize users closest to the provided user are returned.
user
- The user’s rating vector.items
- The items for which neighborhoods are requested.