public abstract class AbstractRatingPredictor extends java.lang.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 |
---|---|
java.util.Map<java.lang.Long,java.lang.Double> |
predict(long user,
java.util.Collection<java.lang.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 java.util.Map<java.lang.Long,java.lang.Double> predict(long user, @Nonnull java.util.Collection<java.lang.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.