public class PrecomputedItemScorer extends AbstractItemScorer implements Serializable
An item scorer that stores a precomputed map of item scores.
| Modifier and Type | Class and Description |
|---|---|
static class |
PrecomputedItemScorer.Builder
Builder for mock item scorers.
|
| Modifier and Type | Method and Description |
|---|---|
static PrecomputedItemScorer |
fromCSV(BufferedReader buf)
Read predictions from a CSV file.
|
static PrecomputedItemScorer.Builder |
newBuilder()
Construct a new builder for precomputed item scorers.
|
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.
|
scorepublic Result score(long user, long item)
AbstractItemScorerScore a single item.
This implementation delegates to ItemScorer.scoreWithDetails(long, Collection).
score in interface ItemScorerscore in class AbstractItemScoreruser - The user ID for whom to generate a score.item - The item ID to score.null if no score can be generated.@Nonnull public ResultMap scoreWithDetails(long user, @Nonnull Collection<Long> items)
ItemScorerScore a collection of items and potentially return more details on the scores.
scoreWithDetails in interface ItemScoreruser - The user ID for whom to generate scores.items - The item to score.ResultMap that provides access to those details.public static PrecomputedItemScorer fromCSV(@WillClose BufferedReader buf)
Read predictions from a CSV file.
buf - A CSV file reader.public static PrecomputedItemScorer.Builder newBuilder()
Construct a new builder for precomputed item scorers. This is useful for building item scorers for mocks.