org.apache.mahout.cf.taste.recommender
Interface Recommender
- All Superinterfaces:
- Refreshable
- All Known Subinterfaces:
- ItemBasedRecommender, UserBasedRecommender
- All Known Implementing Classes:
- AbstractRecommender, CachingRecommender, GenericBooleanPrefItemBasedRecommender, GenericBooleanPrefUserBasedRecommender, GenericItemBasedRecommender, GenericUserBasedRecommender, ItemAverageRecommender, ItemUserAverageRecommender, RandomRecommender, SVDRecommender
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.
recommend
List<RecommendedItem> recommend(long userID,
int howMany)
throws TasteException
- Parameters:
userID - user for which recommendations are to be computedhowMany - desired number of recommendations
- Returns:
List of recommended RecommendedItems, ordered from most strongly recommend to
least
- Throws:
TasteException - if an error occurs while accessing the DataModel
recommend
List<RecommendedItem> recommend(long userID,
int howMany,
IDRescorer rescorer)
throws TasteException
- Parameters:
userID - user for which recommendations are to be computedhowMany - desired number of recommendationsrescorer - rescoring function to apply before final list of recommendations is determined
- Returns:
List of recommended RecommendedItems, ordered from most strongly recommend to
least
- Throws:
TasteException - if an error occurs while accessing the DataModel
estimatePreference
float estimatePreference(long userID,
long itemID)
throws TasteException
- Parameters:
userID - user ID whose preference is to be estimateditemID - item ID to estimate preference for
- Returns:
- an estimated preference if the user has not expressed a preference for the item, or else the
user's actual preference for the item. If a preference cannot be estimated, returns
Double.NaN
- Throws:
TasteException - if an error occurs while accessing the DataModel
setPreference
void setPreference(long userID,
long itemID,
float value)
throws TasteException
- Parameters:
userID - user to set preference foritemID - item to set preference forvalue - preference value
- Throws:
TasteException - if an error occurs while accessing the DataModel
removePreference
void removePreference(long userID,
long itemID)
throws TasteException
- Parameters:
userID - user from which to remove preferenceitemID - item for which to remove preference
- Throws:
TasteException - if an error occurs while accessing the DataModel
getDataModel
DataModel getDataModel()
- Returns:
- underlying
DataModel used by this Recommender implementation
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.