org.apache.mahout.cf.taste.impl.eval
Class GenericRelevantItemsDataSplitter

java.lang.Object
  extended by org.apache.mahout.cf.taste.impl.eval.GenericRelevantItemsDataSplitter
All Implemented Interfaces:
RelevantItemsDataSplitter

public final class GenericRelevantItemsDataSplitter
extends Object
implements RelevantItemsDataSplitter

Picks relevant items to be those with the strongest preference, and includes the other users' preferences in full.


Constructor Summary
GenericRelevantItemsDataSplitter()
           
 
Method Summary
 FastIDSet getRelevantItemsIDs(long userID, int at, double relevanceThreshold, DataModel dataModel)
          During testing, relevant items are removed from a particular users' preferences, and a model is build using this user's other preferences and all other users.
 void processOtherUser(long userID, FastIDSet relevantItemIDs, FastByIDMap<PreferenceArray> trainingUsers, long otherUserID, DataModel dataModel)
          Adds a single user and all their preferences to the training model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericRelevantItemsDataSplitter

public GenericRelevantItemsDataSplitter()
Method Detail

getRelevantItemsIDs

public FastIDSet getRelevantItemsIDs(long userID,
                                     int at,
                                     double relevanceThreshold,
                                     DataModel dataModel)
                              throws TasteException
Description copied from interface: RelevantItemsDataSplitter
During testing, relevant items are removed from a particular users' preferences, and a model is build using this user's other preferences and all other users.

Specified by:
getRelevantItemsIDs in interface RelevantItemsDataSplitter
at - Maximum number of items to be removed
relevanceThreshold - Minimum strength of preference for an item to be considered relevant
Returns:
IDs of relevant items
Throws:
TasteException

processOtherUser

public void processOtherUser(long userID,
                             FastIDSet relevantItemIDs,
                             FastByIDMap<PreferenceArray> trainingUsers,
                             long otherUserID,
                             DataModel dataModel)
                      throws TasteException
Description copied from interface: RelevantItemsDataSplitter
Adds a single user and all their preferences to the training model.

Specified by:
processOtherUser in interface RelevantItemsDataSplitter
Parameters:
userID - ID of user whose preferences we are trying to predict
relevantItemIDs - IDs of items considered relevant to that user
trainingUsers - the database of training preferences to which we will append the ones for otherUserID.
otherUserID - for whom we are adding preferences to the training model
Throws:
TasteException


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.