org.apache.mahout.cf.taste.example.grouplens
Class GroupLensRecommender
java.lang.Object
org.apache.mahout.cf.taste.example.grouplens.GroupLensRecommender
- All Implemented Interfaces:
- Refreshable, Recommender
public final class GroupLensRecommender
- extends Object
- implements Recommender
A simple Recommender
implemented for the GroupLens demo.
GroupLensRecommender
public GroupLensRecommender()
throws IOException,
TasteException
- Throws:
IOException
TasteException
GroupLensRecommender
public GroupLensRecommender(DataModel dataModel)
throws TasteException
Alternate constructor that takes a DataModel
argument, which allows this Recommender
to be used with the RecommenderEvaluator
framework.
- Parameters:
dataModel
- data model
- Throws:
TasteException
- if an error occurs while initializing this
recommend
public List<RecommendedItem> recommend(long userID,
int howMany)
throws TasteException
- Specified by:
recommend
in interface Recommender
- Throws:
TasteException
recommend
public List<RecommendedItem> recommend(long userID,
int howMany,
IDRescorer rescorer)
throws TasteException
- Specified by:
recommend
in interface Recommender
- Throws:
TasteException
estimatePreference
public float estimatePreference(long userID,
long itemID)
throws TasteException
- Specified by:
estimatePreference
in interface Recommender
- Throws:
TasteException
setPreference
public void setPreference(long userID,
long itemID,
float value)
throws TasteException
- Specified by:
setPreference
in interface Recommender
- Throws:
TasteException
removePreference
public void removePreference(long userID,
long itemID)
throws TasteException
- Specified by:
removePreference
in interface Recommender
- Throws:
TasteException
getDataModel
public DataModel getDataModel()
- Specified by:
getDataModel
in interface Recommender
refresh
public void refresh(Collection<Refreshable> alreadyRefreshed)
- Specified by:
refresh
in interface Refreshable
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.