public abstract class AbstractRatingPredictor extends Object implements RatingPredictor
Base class to make item scorers easier to implement. Delegates all score methods to RatingPredictor.predictWithDetails(long, Collection)
.
Constructor and Description |
---|
AbstractRatingPredictor() |
Modifier and Type | Method and Description |
---|---|
Map<Long,Double> |
predict(long user,
Collection<Long> items)
Predict the user’s preference for a collection of items.
|
Result |
predict(long user,
long item)
Predict a user’s rating for a single item.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
predictWithDetails
public Result predict(long user, long item)
Predict a user’s rating for a single item.
This implementation delegates to RatingPredictor.predictWithDetails(long, Collection)
.
predict
in interface RatingPredictor
user
- The user ID for whom to generate a prediction.item
- The item ID whose rating is to be predicted.Double.NaN
if no preference can be predicted.@Nonnull public Map<Long,Double> predict(long user, @Nonnull Collection<Long> items)
Predict the user’s preference for a collection of items.
This implementation delegates to RatingPredictor.predictWithDetails(long, Collection)
.
predict
in interface RatingPredictor
user
- The user ID for whom to generate predicts.items
- The items to predict for.