public interface Recommender extends Refreshable
Implementations of this interface can recommend items for a user. Implementations will likely take advantage of several classes in other packages here to compute this.
Modifier and Type | Method and Description |
---|---|
float |
estimatePreference(long userID,
long itemID) |
DataModel |
getDataModel() |
List<RecommendedItem> |
recommend(long userID,
int howMany) |
List<RecommendedItem> |
recommend(long userID,
int howMany,
boolean includeKnownItems) |
List<RecommendedItem> |
recommend(long userID,
int howMany,
IDRescorer rescorer) |
List<RecommendedItem> |
recommend(long userID,
int howMany,
IDRescorer rescorer,
boolean includeKnownItems) |
void |
removePreference(long userID,
long itemID) |
void |
setPreference(long userID,
long itemID,
float value) |
refresh
List<RecommendedItem> recommend(long userID, int howMany) throws TasteException
userID
- user for which recommendations are to be computedhowMany
- desired number of recommendationsList
of recommended RecommendedItem
s, ordered from most strongly recommend to
leastTasteException
- if an error occurs while accessing the DataModel
List<RecommendedItem> recommend(long userID, int howMany, boolean includeKnownItems) throws TasteException
userID
- user for which recommendations are to be computedhowMany
- desired number of recommendationsincludeKnownItems
- whether to include items already known by the user in recommendationsList
of recommended RecommendedItem
s, ordered from most strongly recommend to
leastTasteException
- if an error occurs while accessing the DataModel
List<RecommendedItem> recommend(long userID, int howMany, IDRescorer rescorer) throws TasteException
userID
- user for which recommendations are to be computedhowMany
- desired number of recommendationsrescorer
- rescoring function to apply before final list of recommendations is determinedList
of recommended RecommendedItem
s, ordered from most strongly recommend to
leastTasteException
- if an error occurs while accessing the DataModel
List<RecommendedItem> recommend(long userID, int howMany, IDRescorer rescorer, boolean includeKnownItems) throws TasteException
userID
- user for which recommendations are to be computedhowMany
- desired number of recommendationsrescorer
- rescoring function to apply before final list of recommendations is determinedincludeKnownItems
- whether to include items already known by the user in recommendationsList
of recommended RecommendedItem
s, ordered from most strongly recommend to
leastTasteException
- if an error occurs while accessing the DataModel
float estimatePreference(long userID, long itemID) throws TasteException
userID
- user ID whose preference is to be estimateditemID
- item ID to estimate preference forDouble.NaN
TasteException
- if an error occurs while accessing the DataModel
void setPreference(long userID, long itemID, float value) throws TasteException
userID
- user to set preference foritemID
- item to set preference forvalue
- preference valueTasteException
- if an error occurs while accessing the DataModel
void removePreference(long userID, long itemID) throws TasteException
userID
- user from which to remove preferenceitemID
- item for which to remove preferenceTasteException
- if an error occurs while accessing the DataModel
DataModel getDataModel()
DataModel
used by this Recommender
implementationCopyright © 2008–2017 The Apache Software Foundation. All rights reserved.