@ThreadSafe public class SnapshotNeighborFinder extends java.lang.Object implements NeighborFinder
A neighborhood finder that has a snapshot of the rating data for efficiency.
| Constructor and Description |
|---|
SnapshotNeighborFinder(UserSnapshot snap,
UserSimilarity sim,
RatingVectorPDAO rvd,
UserVectorNormalizer simNorm,
Threshold thresh) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Iterable<Neighbor> |
getCandidateNeighbors(long user,
LongSet items)
Get potential neighbors for a particular user.
|
@Inject public SnapshotNeighborFinder(UserSnapshot snap, UserSimilarity sim, RatingVectorPDAO rvd, @SimilarityNormalizer UserVectorNormalizer simNorm, @UserSimilarityThreshold Threshold thresh)
public java.lang.Iterable<Neighbor> getCandidateNeighbors(long user, LongSet items)
NeighborFinderGet potential neighbors for a particular user.
getCandidateNeighbors in interface NeighborFinderuser - The user ID whose neighbors are wanted.items - The items that the client needs to be able to score or recommend.user. This collection may include neighbors that are not useful for scoring any item in items; the item set is just to help the neighbor finder guide its search if relevant.