org.mymedialite.eval
Class ItemsFiltered

java.lang.Object
  extended by org.mymedialite.eval.ItemsFiltered

public class ItemsFiltered
extends java.lang.Object

Evaluation class for filtered item recommendation.


Method Summary
static ItemRecommendationEvaluationResults evaluateFiltered(IRecommender recommender, IPosOnlyFeedback test, IPosOnlyFeedback train, SparseBooleanMatrix item_attributes, java.util.List<java.lang.Integer> test_users, java.util.List<java.lang.Integer> candidate_items, boolean repeated_events)
          Evaluation for rankings of filtered items.
static java.util.HashMap<java.lang.Integer,java.util.Collection<java.lang.Integer>> getFilteredItems(int user_id, IPosOnlyFeedback test, SparseBooleanMatrix item_attributes)
          For a given user and the test dataset, return a dictionary of items filtered by attributes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFilteredItems

public static java.util.HashMap<java.lang.Integer,java.util.Collection<java.lang.Integer>> getFilteredItems(int user_id,
                                                                                                            IPosOnlyFeedback test,
                                                                                                            SparseBooleanMatrix item_attributes)
For a given user and the test dataset, return a dictionary of items filtered by attributes.

Parameters:
user_id - the user ID
test - the test dataset
item_attributes -
Returns:
a dictionary containing a mapping from attribute IDs to collections of item IDs

evaluateFiltered

public static ItemRecommendationEvaluationResults evaluateFiltered(IRecommender recommender,
                                                                   IPosOnlyFeedback test,
                                                                   IPosOnlyFeedback train,
                                                                   SparseBooleanMatrix item_attributes,
                                                                   java.util.List<java.lang.Integer> test_users,
                                                                   java.util.List<java.lang.Integer> candidate_items,
                                                                   boolean repeated_events)
                                                            throws java.lang.Exception
Evaluation for rankings of filtered items.

Parameters:
recommender - item recommender
test - test cases
train - training data
item_attributes - the item attributes to be used for filtering
test_users - a collection of integers with all test users
candidate_items - a collection of integers with all candidate items
repeated_events - allow repeated events in the evaluation (i.e. items accessed by a user before may be in the recommended list)
Returns:
a dictionary containing the evaluation results
Throws:
java.lang.Exception