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

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

public class SamplingCandidateItemsStrategy
extends AbstractCandidateItemsStrategy

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
protected  FastIDSet doGetCandidateItems(long[] preferredItemIDs, DataModel dataModel)
           
 
Methods inherited from class org.apache.mahout.cf.taste.impl.recommender.AbstractCandidateItemsStrategy
getCandidateItems, getCandidateItems
 
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

doGetCandidateItems

protected FastIDSet doGetCandidateItems(long[] preferredItemIDs,
                                        DataModel dataModel)
                                 throws TasteException
Throws:
TasteException


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