org.apache.mahout.cf.taste.impl.recommender
Class GenericBooleanPrefUserBasedRecommender
java.lang.Object
org.apache.mahout.cf.taste.impl.recommender.AbstractRecommender
org.apache.mahout.cf.taste.impl.recommender.GenericUserBasedRecommender
org.apache.mahout.cf.taste.impl.recommender.GenericBooleanPrefUserBasedRecommender
- All Implemented Interfaces:
- Refreshable, Recommender, UserBasedRecommender
public final class GenericBooleanPrefUserBasedRecommender
- extends GenericUserBasedRecommender
A variant on GenericUserBasedRecommender
which is appropriate for use when no notion of preference
value exists in the data.
Method Summary |
protected float |
doEstimatePreference(long theUserID,
long[] theNeighborhood,
long itemID)
This computation is in a technical sense, wrong, since in the domain of "boolean preference users" where
all preference values are 1, this method should only ever return 1.0 or NaN. |
protected FastIDSet |
getAllOtherItems(long[] theNeighborhood,
long theUserID)
|
String |
toString()
|
GenericBooleanPrefUserBasedRecommender
public GenericBooleanPrefUserBasedRecommender(DataModel dataModel,
UserNeighborhood neighborhood,
UserSimilarity similarity)
doEstimatePreference
protected float doEstimatePreference(long theUserID,
long[] theNeighborhood,
long itemID)
throws TasteException
- This computation is in a technical sense, wrong, since in the domain of "boolean preference users" where
all preference values are 1, this method should only ever return 1.0 or NaN. This isn't terribly useful
however since it means results can't be ranked by preference value (all are 1). So instead this returns a
sum of similarities to any other user in the neighborhood who has also rated the item.
- Overrides:
doEstimatePreference
in class GenericUserBasedRecommender
- Throws:
TasteException
getAllOtherItems
protected FastIDSet getAllOtherItems(long[] theNeighborhood,
long theUserID)
throws TasteException
- Overrides:
getAllOtherItems
in class GenericUserBasedRecommender
- Throws:
TasteException
toString
public String toString()
- Overrides:
toString
in class GenericUserBasedRecommender
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.