public class RescoringItemRecommender extends Object implements ItemRecommender
Modifier and Type | Field and Description |
---|---|
static Symbol |
ORIGINAL_SCORE_SYMBOL |
Constructor and Description |
---|
RescoringItemRecommender(ItemRecommender rec,
ItemScorer score)
Create a new rescoring item recommender.
|
Modifier and Type | Method and Description |
---|---|
List<ScoredId> |
recommend(long user)
Recommend all possible items for a user using the default exclude set.
|
List<ScoredId> |
recommend(long user,
int n)
Recommend up to n items for a user using the default exclude
set.
|
List<ScoredId> |
recommend(long user,
int n,
Set<Long> candidates,
Set<Long> exclude)
Produce a set of recommendations for the user.
|
List<ScoredId> |
recommend(long user,
Set<Long> candidates)
Recommend all possible items for a user from a set of candidates using
the default exclude set.
|
public static final Symbol ORIGINAL_SCORE_SYMBOL
@Inject public RescoringItemRecommender(ItemRecommender rec, ItemScorer score)
rec
- The recommender.score
- The item scorer.public List<ScoredId> recommend(long user)
ItemRecommender
recommend
in interface ItemRecommender
user
- The user ID.ItemRecommender.recommend(long, int, Set, Set)
public List<ScoredId> recommend(long user, int n)
ItemRecommender
recommend
in interface ItemRecommender
user
- The user ID.n
- The number of recommendations to return.ItemRecommender.recommend(long, int, Set, Set)
public List<ScoredId> recommend(long user, @Nullable Set<Long> candidates)
ItemRecommender
recommend
in interface ItemRecommender
user
- The user ID.candidates
- The candidate set (can be null to represent the
universe).ItemRecommender.recommend(long, int, Set, Set)
public List<ScoredId> recommend(long user, int n, @Nullable Set<Long> candidates, @Nullable Set<Long> exclude)
ItemRecommender
recommend
in interface ItemRecommender
user
- The user's IDn
- The number of ratings to return. If negative, there is
no specific recommendation list size requested.candidates
- A set of candidate items which can be recommended. If
null
, all items are considered candidates.exclude
- A set of items to be excluded. If null
, a default
exclude set is used.Double.NaN
. For
most scoring recommenders, the items will be ordered in
decreasing order of score. This is not a hard requirement — e.g.
set recommenders are allowed to be more flexible.