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) |
refreshList<RecommendedItem> recommend(long userID, int howMany) throws TasteException
userID - user for which recommendations are to be computedhowMany - desired number of recommendationsList of recommended RecommendedItems, ordered from most strongly recommend to
leastTasteException - if an error occurs while accessing the DataModelList<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 RecommendedItems, ordered from most strongly recommend to
leastTasteException - if an error occurs while accessing the DataModelList<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 RecommendedItems, ordered from most strongly recommend to
leastTasteException - if an error occurs while accessing the DataModelList<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 RecommendedItems, ordered from most strongly recommend to
leastTasteException - if an error occurs while accessing the DataModelfloat estimatePreference(long userID,
long itemID)
throws TasteException
userID - user ID whose preference is to be estimateditemID - item ID to estimate preference forDouble.NaNTasteException - if an error occurs while accessing the DataModelvoid 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 DataModelvoid 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 DataModelDataModel getDataModel()
DataModel used by this Recommender implementationCopyright © 2008–2017 The Apache Software Foundation. All rights reserved.