org.mymedialite.eval
Class ItemsCrossValidation

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

public class ItemsCrossValidation
extends java.lang.Object

Cross-validation for item recommendation.


Method Summary
static ItemRecommendationEvaluationResults doCrossValidation(IRecommender recommender, int num_folds, java.util.List<java.lang.Integer> test_users, java.util.List<java.lang.Integer> candidate_items, CandidateItems candidate_item_mode, boolean show_results)
          Evaluate on the folds of a dataset split.
static ItemRecommendationEvaluationResults doCrossValidation(IRecommender recommender, ISplit<IPosOnlyFeedback> split, java.util.List<java.lang.Integer> test_users, java.util.List<java.lang.Integer> candidate_items, CandidateItems candidate_item_mode, boolean show_results)
          Evaluate on the folds of a dataset split.
static void doIterativeCrossValidation(IRecommender recommender, int num_folds, java.util.List<java.lang.Integer> test_users, java.util.List<java.lang.Integer> candidate_items, CandidateItems candidate_item_mode, boolean repeated_events, int max_iter, int find_iter)
          Evaluate an iterative recommender on the folds of a dataset split, display results on STDOUT.
static void doIterativeCrossValidation(IRecommender recommender, ISplit<IPosOnlyFeedback> split, java.util.List<java.lang.Integer> test_users, java.util.List<java.lang.Integer> candidate_items, CandidateItems candidate_item_mode, boolean repeated_events, int max_iter, int find_iter)
          Evaluate an iterative recommender on the folds of a dataset split, display results on STDOUT.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

doCrossValidation

public static ItemRecommendationEvaluationResults doCrossValidation(IRecommender recommender,
                                                                    int num_folds,
                                                                    java.util.List<java.lang.Integer> test_users,
                                                                    java.util.List<java.lang.Integer> candidate_items,
                                                                    CandidateItems candidate_item_mode,
                                                                    boolean show_results)
                                                             throws java.lang.Exception
Evaluate on the folds of a dataset split.

Parameters:
recommender - an item recommender
num_folds - the number of folds
test_users - a collection of integers with all test users
candidate_items - a collection of integers with all candidate items
candidate_item_mode - the mode used to determine the candidate items
show_results - set to true to print results to STDERR
Returns:
a dictionary containing the average results over the different folds of the split
Throws:
java.lang.Exception

doCrossValidation

public static ItemRecommendationEvaluationResults doCrossValidation(IRecommender recommender,
                                                                    ISplit<IPosOnlyFeedback> split,
                                                                    java.util.List<java.lang.Integer> test_users,
                                                                    java.util.List<java.lang.Integer> candidate_items,
                                                                    CandidateItems candidate_item_mode,
                                                                    boolean show_results)
                                                             throws java.lang.Exception
Evaluate on the folds of a dataset split.

Parameters:
recommender - an item recommender
split - a dataset split
test_users - a collection of integers with all test users
candidate_items - a collection of integers with all candidate items
candidate_item_mode - the mode used to determine the candidate items
show_results - set to true to print results to STDERR
Returns:
a dictionary containing the average results over the different folds of the split
Throws:
java.lang.Exception

doIterativeCrossValidation

public static void doIterativeCrossValidation(IRecommender recommender,
                                              int num_folds,
                                              java.util.List<java.lang.Integer> test_users,
                                              java.util.List<java.lang.Integer> candidate_items,
                                              CandidateItems candidate_item_mode,
                                              boolean repeated_events,
                                              int max_iter,
                                              int find_iter)
                                       throws java.lang.Exception
Evaluate an iterative recommender on the folds of a dataset split, display results on STDOUT.

Parameters:
recommender - an item recommender
num_folds - the number of folds
test_users - a collection of integers with all test users
candidate_items - a collection of integers with all candidate items
candidate_item_mode - the mode used to determine the candidate items
repeated_events - allow repeated events in the evaluation (i.e. items accessed by a user before may be in the recommended list)
max_iter - the maximum number of iterations
find_iter - the report interval
Throws:
java.lang.Exception

doIterativeCrossValidation

public static void doIterativeCrossValidation(IRecommender recommender,
                                              ISplit<IPosOnlyFeedback> split,
                                              java.util.List<java.lang.Integer> test_users,
                                              java.util.List<java.lang.Integer> candidate_items,
                                              CandidateItems candidate_item_mode,
                                              boolean repeated_events,
                                              int max_iter,
                                              int find_iter)
                                       throws java.lang.Exception
Evaluate an iterative recommender on the folds of a dataset split, display results on STDOUT.

Parameters:
recommender - an item recommender
split - a positive-only feedback dataset split
test_users - a collection of integers with all test users
candidate_items - a collection of integers with all candidate items
candidate_item_mode - the mode used to determine the candidate items
repeated_events - allow repeated events in the evaluation (i.e. items accessed by a user before may be in the recommended list)
max_iter - the maximum number of iterations
find_iter - the report interval
Throws:
java.lang.Exception