org.apache.mahout.cf.taste.impl.recommender
Class SamplingCandidateItemsStrategy

java.lang.Object
  extended by org.apache.mahout.cf.taste.impl.recommender.SamplingCandidateItemsStrategy
All Implemented Interfaces:
CandidateItemsStrategy

public class SamplingCandidateItemsStrategy
extends java.lang.Object
implements CandidateItemsStrategy

returns all items that have not been rated by the user and that were preferred by another user that has preferred at least one item that the current user has preferred too

this strategy uses sampling in a way that only a certain amount of preferences per item is considered

 max(defaultMaxPrefsPerItemConsidered, userItemCountFactor * log(max(N_users, N_items)))
 


Constructor Summary
SamplingCandidateItemsStrategy()
          uses defaultMaxPrefsPerItemConsidered = 100 and userItemCountMultiplier = 20 as default values
SamplingCandidateItemsStrategy(int defaultMaxPrefsPerItemConsidered, int userItemCountMultiplier)
          the maximum number of prefs considered per item will be computed like this:
 
Method Summary
 FastIDSet getCandidateItems(long userID, DataModel dataModel)
          #return IDs of all items that could be recommended to the user
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SamplingCandidateItemsStrategy

public SamplingCandidateItemsStrategy()
uses defaultMaxPrefsPerItemConsidered = 100 and userItemCountMultiplier = 20 as default values

See Also:
SamplingCandidateItemsStrategy(int, int)

SamplingCandidateItemsStrategy

public SamplingCandidateItemsStrategy(int defaultMaxPrefsPerItemConsidered,
                                      int userItemCountMultiplier)

the maximum number of prefs considered per item will be computed like this:

   max(defaultMaxPrefsPerItemConsidered, userItemCountFactor * log(max(N_users, N_items)))
 

Parameters:
defaultMaxPrefsPerItemConsidered -
userItemCountMultiplier -
Method Detail

getCandidateItems

public FastIDSet getCandidateItems(long userID,
                                   DataModel dataModel)
                            throws TasteException
Description copied from interface: CandidateItemsStrategy
#return IDs of all items that could be recommended to the user

Specified by:
getCandidateItems in interface CandidateItemsStrategy
Throws:
TasteException


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