public class LiveNeighborFinder extends java.lang.Object implements NeighborFinder
Neighborhood finder that does a fresh search over the data source ever time.
| Constructor and Description |
|---|
LiveNeighborFinder(RatingVectorPDAO rvd,
DataAccessObject dao,
UserSimilarity sim,
UserVectorNormalizer scoreNorm,
UserVectorNormalizer simNorm,
Threshold thresh)
Construct a new user neighborhood finder.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Iterable<Neighbor> |
getCandidateNeighbors(long user,
LongSet items)
Get potential neighbors for a particular user.
|
@Inject public LiveNeighborFinder(RatingVectorPDAO rvd, DataAccessObject dao, UserSimilarity sim, @ScoreNormalizer UserVectorNormalizer scoreNorm, @SimilarityNormalizer UserVectorNormalizer simNorm, @UserSimilarityThreshold Threshold thresh)
Construct a new user neighborhood finder.
rvd - The user rating vector dAO.dao - The data access object.sim - The similarity function to use.scoreNorm - The normalizer for normalizing user rating vectors.simNorm - The normalizer for computing similarity between user rating/preference vectors.thresh - The threshold for user similarities.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.