public final class SimpleRatingPredictor extends AbstractRatingPredictor
RatingPredictor
backed by an
ItemScorer
. The scores are clamped to the preference domain
but otherwise unmodified.
If a baseline predictor is provided, then it is used to supply predictions that the item scorer could not.
This class has a provider SimpleRatingPredictor.Provider
that is the default provider
for RatingPredictor
.
Modifier and Type | Class and Description |
---|---|
static class |
SimpleRatingPredictor.Provider
An intelligent provider for simple rating predictors.
|
Modifier and Type | Field and Description |
---|---|
static TypedSymbol<ScoreSource> |
PREDICTION_SOURCE_SYMBOL |
Constructor and Description |
---|
SimpleRatingPredictor(ItemScorer scorer,
ItemScorer baseline,
PreferenceDomain domain) |
Modifier and Type | Method and Description |
---|---|
ItemScorer |
getBaselineScorer()
Get the baseline predictor.
|
PreferenceDomain |
getPreferenceDomain()
Get the preference domain.
|
ItemScorer |
getScorer()
Get the backing scorer.
|
void |
predict(long user,
MutableSparseVector scores)
Predict for items in a vector.
|
predict, predict
public static final TypedSymbol<ScoreSource> PREDICTION_SOURCE_SYMBOL
@Inject public SimpleRatingPredictor(@PrimaryScorer ItemScorer scorer, @Nullable @BaselineScorer ItemScorer baseline, @Nullable PreferenceDomain domain)
public ItemScorer getScorer()
@Nullable public PreferenceDomain getPreferenceDomain()
@Nullable public ItemScorer getBaselineScorer()
null
if no baseline is configured.public void predict(long user, @Nonnull MutableSparseVector scores)
RatingPredictor
user
- The user ID.scores
- The prediction output vector. Its key domain is the items to score.