public interface RatingPredictor extends ItemScorer
ItemScorer
, but its output will be
predicted ratings.
Note: The fact that this interface extends ItemScorer
is deprecated.
Compatibility: Public
Modifier and Type | Method and Description |
---|---|
boolean |
canUseHistory()
Query whether this predictor can actually use user history.
|
SparseVector |
predict(long user,
Collection<Long> items)
Predict the user's preference for a collection of items.
|
double |
predict(long user,
long item)
Prdict a user's rating for a single item.
|
void |
predict(long user,
MutableSparseVector predictions)
Predict for items in a vector.
|
SparseVector |
predict(UserHistory<? extends Event> profile,
Collection<Long> items)
Predict a collection of items for the user using a history.
|
double |
predict(UserHistory<? extends Event> profile,
long item)
Predict a user's preference for an item using a history.
|
void |
predict(UserHistory<? extends Event> profile,
MutableSparseVector predictions)
Predict for items in a vector.
|
SparseVector |
score(long user,
Collection<Long> items)
Deprecated.
|
double |
score(long user,
long item)
Deprecated.
|
void |
score(long user,
MutableSparseVector scores)
Deprecated.
|
SparseVector |
score(UserHistory<? extends Event> profile,
Collection<Long> items)
Deprecated.
|
double |
score(UserHistory<? extends Event> profile,
long item)
Deprecated.
|
void |
score(UserHistory<? extends Event> profile,
MutableSparseVector scores)
Deprecated.
|
boolean canUseHistory()
canUseHistory
in interface ItemScorer
true
if the history passed to one of the history-based
methods may be used, and false
if it will be ignored.double predict(long user, long item)
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.predict(UserHistory, MutableSparseVector)
@Nonnull SparseVector predict(long user, @Nonnull Collection<Long> items)
user
- The user ID for whom to generate predicts.items
- The items to predict for.predict(UserHistory, MutableSparseVector)
void predict(long user, @Nonnull MutableSparseVector predictions)
user
- The user ID.predictions
- The prediction output vector. Its key domain is the items to score.predict(UserHistory, MutableSparseVector)
double predict(@Nonnull UserHistory<? extends Event> profile, long item)
profile
- The user's profile.item
- The item to predict.Double.NaN
if no predict can be computed.predict(UserHistory, MutableSparseVector)
@Nonnull SparseVector predict(@Nonnull UserHistory<? extends Event> profile, @Nonnull Collection<Long> items)
profile
- The user's profileitems
- The items to predict.predict(UserHistory, MutableSparseVector)
void predict(@Nonnull UserHistory<? extends Event> profile, @Nonnull MutableSparseVector predictions)
If the user has rated any items to be predicted, the algorithm should not just use their rating as the predict — it should compute a predict in the normal fashion. If client code wants to substitute ratings, it is easy to do so as a separate step or wrapper interface.
profile
- The user history.predictions
- The prediction output vector.@Deprecated double score(long user, long item)
predict(long, long)
score
in interface ItemScorer
user
- The user ID for whom to generate a score.item
- The item ID to score.Double.NaN
if no score can be generated.ItemScorer.score(UserHistory, MutableSparseVector)
@Deprecated @Nonnull SparseVector score(long user, @Nonnull Collection<Long> items)
predict(long, Collection)
score
in interface ItemScorer
user
- The user ID for whom to generate scores.items
- The item to score.ItemScorer.score(UserHistory, MutableSparseVector)
@Deprecated void score(long user, @Nonnull MutableSparseVector scores)
predict(long, MutableSparseVector)
score
in interface ItemScorer
user
- The user ID.scores
- The score vector.ItemScorer.score(UserHistory, MutableSparseVector)
@Deprecated double score(@Nonnull UserHistory<? extends Event> profile, long item)
predict(UserHistory, long)
score
in interface ItemScorer
profile
- The user's profile.item
- The item to score.Double.NaN
if no score can be computed.ItemScorer.score(UserHistory, MutableSparseVector)
@Deprecated @Nonnull SparseVector score(@Nonnull UserHistory<? extends Event> profile, @Nonnull Collection<Long> items)
predict(UserHistory, Collection)
score
in interface ItemScorer
profile
- The user's profileitems
- The items to score.ItemScorer.score(UserHistory, MutableSparseVector)
@Deprecated void score(@Nonnull UserHistory<? extends Event> profile, @Nonnull MutableSparseVector scores)
predict(UserHistory, MutableSparseVector)
If the user has rated any items to be scored, the algorithm should not just use their rating as the score — it should compute a score in the normal fashion. If client code wants to substitute ratings, it is easy to do so as a separate step or wrapper interface.
score
in interface ItemScorer
profile
- The user history.scores
- The score vector.Copyright © 2013 GroupLens Research. All Rights Reserved.