edu.qut.cs.rcmd.core.tag.recommender.impl
Class AbstractTagRecommender
java.lang.Object
edu.qut.cs.rcmd.core.tag.recommender.impl.AbstractTagRecommender
- All Implemented Interfaces:
- TagRecommender
- Direct Known Subclasses:
- GenericUserBasedTagRecommender
public class AbstractTagRecommender
- extends Object
- implements TagRecommender
- Author:
- n7374186
Method Summary |
float |
estimateTagScore(long userID,
long itemID,
String tag)
|
protected Set<String> |
getCandidateTags(long userID,
long itemID,
org.apache.mahout.cf.taste.model.PreferenceArray preferencesFromUser)
|
org.apache.mahout.cf.taste.model.DataModel |
getDataModel()
|
protected static CandidateTagsStrategy |
getDefaultCandidateTagsStrategy()
|
TagModel |
getTagModel()
|
List<RecommendedTag> |
recommend(long userID,
long itemID,
int howMany)
|
List<RecommendedTag> |
recommend(long userID,
long itemID,
int howMany,
org.apache.mahout.cf.taste.recommender.IDRescorer rescorer)
|
void |
removeTagScore(long userID,
long itemID,
String tag)
|
void |
setTagScore(long userID,
long itemID,
String tag,
float value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractTagRecommender
protected AbstractTagRecommender(org.apache.mahout.cf.taste.model.DataModel dataModel,
TagModel tagModel,
CandidateTagsStrategy candidateTagsStrategy)
AbstractTagRecommender
protected AbstractTagRecommender(org.apache.mahout.cf.taste.model.DataModel dataModel,
TagModel tagModel)
getDefaultCandidateTagsStrategy
protected static CandidateTagsStrategy getDefaultCandidateTagsStrategy()
recommend
public List<RecommendedTag> recommend(long userID,
long itemID,
int howMany)
throws org.apache.mahout.cf.taste.common.TasteException
- Specified by:
recommend
in interface TagRecommender
- Parameters:
userID
- user for which recommendations are to be computeditemID
- item for which recommendations are to be computedhowMany
- desired number of recommendations
- Returns:
List
of recommended RecommendedTag
s, ordered from
most strongly recommend to least
- Throws:
org.apache.mahout.cf.taste.common.TasteException
- if an error occurs while accessing the DataModel
recommend
public List<RecommendedTag> recommend(long userID,
long itemID,
int howMany,
org.apache.mahout.cf.taste.recommender.IDRescorer rescorer)
throws org.apache.mahout.cf.taste.common.TasteException
- Specified by:
recommend
in interface TagRecommender
- Parameters:
userID
- user for which recommendations are to be computeditemID
- item 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 RecommendedItem
s, ordered
from most strongly recommend to least
- Throws:
org.apache.mahout.cf.taste.common.TasteException
- if an error occurs while accessing the DataModel
getDataModel
public org.apache.mahout.cf.taste.model.DataModel getDataModel()
- Specified by:
getDataModel
in interface TagRecommender
- Returns:
- underlying
DataModel
used by this implementation
currently using TagModel interface from core.model.tag
(Soloman's)
getTagModel
public TagModel getTagModel()
- Specified by:
getTagModel
in interface TagRecommender
estimateTagScore
public float estimateTagScore(long userID,
long itemID,
String tag)
throws org.apache.mahout.cf.taste.common.TasteException
- Specified by:
estimateTagScore
in interface TagRecommender
- Parameters:
userID
- user ID whose tag score is to be estimateditemID
- item ID to estimate tag score fortag
- tag to estimate tag score for
- Returns:
- an estimated tag score if the tag has not been expressed a tag
score for the item for this user, or else the actual tag score
for the tag. If a tag score cannot be estimated, returns
Double.NaN
- Throws:
org.apache.mahout.cf.taste.common.TasteException
- if an error occurs while accessing the DataModel
setTagScore
public void setTagScore(long userID,
long itemID,
String tag,
float value)
throws org.apache.mahout.cf.taste.common.TasteException
- Specified by:
setTagScore
in interface TagRecommender
- Parameters:
userID
- user to set tag score foritemID
- item to set tag score fortag
- tag to set tag score forvalue
- tag score value
- Throws:
org.apache.mahout.cf.taste.common.TasteException
- if an error occurs while accessing the DataModel
removeTagScore
public void removeTagScore(long userID,
long itemID,
String tag)
throws org.apache.mahout.cf.taste.common.TasteException
- Specified by:
removeTagScore
in interface TagRecommender
- Parameters:
userID
- user from which to remove tag scoreitemID
- item for which to remove tag scoretag
- tag for which to remove tag score
- Throws:
org.apache.mahout.cf.taste.common.TasteException
- if an error occurs while accessing the DataModel
getCandidateTags
protected Set<String> getCandidateTags(long userID,
long itemID,
org.apache.mahout.cf.taste.model.PreferenceArray preferencesFromUser)
throws org.apache.mahout.cf.taste.common.TasteException
- Throws:
org.apache.mahout.cf.taste.common.TasteException
Copyright © 2012. All Rights Reserved.