org.apache.mahout.cf.taste.recommender
Interface Recommender

All Superinterfaces:
Refreshable
All Known Subinterfaces:
ClusteringRecommender, ItemBasedRecommender, UserBasedRecommender
All Known Implementing Classes:
AbstractRecommender, CachingRecommender, GenericBooleanPrefUserBasedRecommender, GenericItemBasedRecommender, GenericUserBasedRecommender, ItemAverageRecommender, ItemUserAverageRecommender, KnnItemBasedRecommender, RandomRecommender, SlopeOneRecommender, SVDRecommender, TreeClusteringRecommender, TreeClusteringRecommender2

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.


Method Summary
 float estimatePreference(long userID, long itemID)
           
 DataModel getDataModel()
           
 java.util.List<RecommendedItem> recommend(long userID, int howMany)
           
 java.util.List<RecommendedItem> recommend(long userID, int howMany, IDRescorer rescorer)
           
 void removePreference(long userID, long itemID)
           
 void setPreference(long userID, long itemID, float value)
           
 
Methods inherited from interface org.apache.mahout.cf.taste.common.Refreshable
refresh
 

Method Detail

recommend

java.util.List<RecommendedItem> recommend(long userID,
                                          int howMany)
                                          throws TasteException
Parameters:
userID - user for which recommendations are to be computed
howMany - 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

java.util.List<RecommendedItem> recommend(long userID,
                                          int howMany,
                                          IDRescorer rescorer)
                                          throws TasteException
Parameters:
userID - user for which recommendations are to be computed
howMany - desired number of recommendations
rescorer - 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 estimated
itemID - 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 for
itemID - item to set preference for
value - 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 preference
itemID - item for which to remove preference
Throws:
TasteException - if an error occurs while accessing the DataModel

getDataModel

DataModel getDataModel()


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.