public class RatingPredictorItemScorer extends Object implements ItemScorer
Item scorer that uses rating predictions. Use this if you want to use the outputs of a sophisticated rating predictor somewhere that requires item scorers.
Constructor and Description |
---|
RatingPredictorItemScorer(RatingPredictor pred) |
Modifier and Type | Method and Description |
---|---|
Map<Long,Double> |
score(long user,
Collection<Long> items)
Score a collection of items.
|
Result |
score(long user,
long item)
Score a single item.
|
ResultMap |
scoreWithDetails(long user,
Collection<Long> items)
Score a collection of items and potentially return more details on the scores.
|
@Inject public RatingPredictorItemScorer(RatingPredictor pred)
@Nonnull public ResultMap scoreWithDetails(long user, @Nonnull Collection<Long> items)
ItemScorer
Score a collection of items and potentially return more details on the scores.
scoreWithDetails
in interface ItemScorer
user
- The user ID for whom to generate scores.items
- The item to score.ResultMap
that provides access to those details.public Result score(long user, long item)
ItemScorer
Score a single item.
score
in interface ItemScorer
user
- The user ID for whom to generate a score.item
- The item ID to score.null
if no score can be generated.@Nonnull public Map<Long,Double> score(long user, @Nonnull Collection<Long> items)
ItemScorer
Score a collection of items.
score
in interface ItemScorer
user
- The user ID for whom to generate scores.items
- The item to score.