public class BiasedMFItemScorer extends AbstractItemScorer
Item scorer using biased matrix factorization. This implements SVD-style item scorers.
Constructor and Description |
---|
BiasedMFItemScorer(MFModel mod,
BiasedMFKernel kern,
ItemScorer bl)
Create a new biased MF item scorer.
|
Modifier and Type | Method and Description |
---|---|
MFModel |
getModel() |
protected org.apache.commons.math3.linear.RealVector |
getUserPreferenceVector(long user)
Get a user’s preference vector.
|
ResultMap |
scoreWithDetails(long user,
Collection<Long> items)
Score a collection of items and potentially return more details on the scores.
|
score, score
@Inject public BiasedMFItemScorer(MFModel mod, BiasedMFKernel kern, @BaselineScorer ItemScorer bl)
Create a new biased MF item scorer.
mod
- The model (factorized matrix)kern
- The kernel function to compute scores.bl
- The baseline scorer (used to compute biases).@Nullable protected org.apache.commons.math3.linear.RealVector getUserPreferenceVector(long user)
Get a user’s preference vector.
user
- The user ID.null
if no preferences are available for the user.public MFModel getModel()
@Nonnull public ResultMap scoreWithDetails(long user, @Nonnull Collection<Long> items)
ItemScorer
Score a collection of items and potentially return more details on the scores.
user
- The user ID for whom to generate scores.items
- The item to score.ResultMap
that provides access to those details.