edu.qut.cs.rcmd.core.tag.recommender.impl
Class GenericUserBasedTagRecommender

java.lang.Object
  extended by edu.qut.cs.rcmd.core.tag.recommender.impl.AbstractTagRecommender
      extended by edu.qut.cs.rcmd.core.tag.recommender.impl.GenericUserBasedTagRecommender
All Implemented Interfaces:
TagRecommender, UserBasedTagRecommender

public class GenericUserBasedTagRecommender
extends AbstractTagRecommender
implements UserBasedTagRecommender

Author:
n7374186

Constructor Summary
GenericUserBasedTagRecommender(org.apache.mahout.cf.taste.model.DataModel dataModel, TagModel tagModel, org.apache.mahout.cf.taste.neighborhood.UserNeighborhood neighborhood, org.apache.mahout.cf.taste.similarity.UserSimilarity similarity)
           
 
Method Summary
protected  float doEstimateTagScore(long theUserID, long[] theNeighborhood, long theItemID, String tag)
           
 long[] mostSimilarUserIDs(long l, int i)
           
 long[] mostSimilarUserIDs(long l, int i, org.apache.mahout.cf.taste.recommender.Rescorer<org.apache.mahout.common.LongPair> rscr)
           
 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)
           
 
Methods inherited from class edu.qut.cs.rcmd.core.tag.recommender.impl.AbstractTagRecommender
estimateTagScore, getCandidateTags, getDataModel, getDefaultCandidateTagsStrategy, getTagModel, removeTagScore, setTagScore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.qut.cs.rcmd.core.tag.recommender.TagRecommender
estimateTagScore, getDataModel, getTagModel, removeTagScore, setTagScore
 

Constructor Detail

GenericUserBasedTagRecommender

public GenericUserBasedTagRecommender(org.apache.mahout.cf.taste.model.DataModel dataModel,
                                      TagModel tagModel,
                                      org.apache.mahout.cf.taste.neighborhood.UserNeighborhood neighborhood,
                                      org.apache.mahout.cf.taste.similarity.UserSimilarity similarity)
Method Detail

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
Overrides:
recommend in class AbstractTagRecommender
Parameters:
userID - user for which recommendations are to be computed
itemID - item 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:
org.apache.mahout.cf.taste.common.TasteException - if an error occurs while accessing the DataModel

mostSimilarUserIDs

public long[] mostSimilarUserIDs(long l,
                                 int i)
                          throws org.apache.mahout.cf.taste.common.TasteException
Specified by:
mostSimilarUserIDs in interface UserBasedTagRecommender
Parameters:
l - ID of user for which to find most similar other users
i - desired number of most similar users to find
Returns:
users most similar to the given user
Throws:
org.apache.mahout.cf.taste.common.TasteException - if an error occurs while accessing the DataModel

mostSimilarUserIDs

public long[] mostSimilarUserIDs(long l,
                                 int i,
                                 org.apache.mahout.cf.taste.recommender.Rescorer<org.apache.mahout.common.LongPair> rscr)
                          throws org.apache.mahout.cf.taste.common.TasteException
Specified by:
mostSimilarUserIDs in interface UserBasedTagRecommender
Parameters:
l - ID of user for which to find most similar other users
i - desired number of most similar users to find
rscr - Rescorer which can adjust user-user similarity estimates used to determine most similar users
Returns:
IDs of users most similar to the given user
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)
                               throws org.apache.mahout.cf.taste.common.TasteException
Specified by:
recommend in interface TagRecommender
Overrides:
recommend in class AbstractTagRecommender
Parameters:
userID - user for which recommendations are to be computed
itemID - item for which recommendations are to be computed
howMany - desired number of recommendations
Returns:
List of recommended RecommendedTags, ordered from most strongly recommend to least
Throws:
org.apache.mahout.cf.taste.common.TasteException - if an error occurs while accessing the DataModel

doEstimateTagScore

protected float doEstimateTagScore(long theUserID,
                                   long[] theNeighborhood,
                                   long theItemID,
                                   String tag)
                            throws org.apache.mahout.cf.taste.common.TasteException
Throws:
org.apache.mahout.cf.taste.common.TasteException


Copyright © 2012. All Rights Reserved.