org.mymedialite.eval
Class RatingsCrossValidation

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

public class RatingsCrossValidation
extends java.lang.Object

Cross-validation for rating prediction.


Method Summary
static RatingPredictionEvaluationResults doCrossValidation(RatingPredictor recommender, java.lang.Integer num_folds, java.lang.Boolean compute_fit, java.lang.Boolean show_results)
          Evaluate on the folds of a dataset split.
static RatingPredictionEvaluationResults doCrossValidation(RatingPredictor recommender, ISplit<IRatings> split, java.lang.Boolean compute_fit, java.lang.Boolean show_results)
          Evaluate on the folds of a dataset split.
static void doIterativeCrossValidation(RatingPredictor recommender, int num_folds, int max_iter, java.lang.Integer find_iter)
          Evaluate an iterative recommender on the folds of a dataset split, display results on STDOUT.
static void doIterativeCrossValidation(RatingPredictor recommender, ISplit<IRatings> split, int max_iter, java.lang.Integer 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 RatingPredictionEvaluationResults doCrossValidation(RatingPredictor recommender,
                                                                  java.lang.Integer num_folds,
                                                                  java.lang.Boolean compute_fit,
                                                                  java.lang.Boolean show_results)
                                                           throws java.lang.Exception
Evaluate on the folds of a dataset split.

Parameters:
recommender - a rating predictor
num_folds - the number of folds
compute_fit - if set to true measure fit on the training data as well
show_results - if 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 RatingPredictionEvaluationResults doCrossValidation(RatingPredictor recommender,
                                                                  ISplit<IRatings> split,
                                                                  java.lang.Boolean compute_fit,
                                                                  java.lang.Boolean show_results)
                                                           throws java.lang.Exception
Evaluate on the folds of a dataset split.

Parameters:
recommender - a rating predictor
split - a rating dataset split
compute_fit - if set to true measure fit on the training data as well
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(RatingPredictor recommender,
                                              int num_folds,
                                              int max_iter,
                                              java.lang.Integer find_iter)
                                       throws java.lang.Exception
Evaluate an iterative recommender on the folds of a dataset split, display results on STDOUT.

Parameters:
recommender - a rating predictor
num_folds - the number of folds
max_iter - the maximum number of iterations
find_iter - the report interval
Throws:
java.lang.Exception

doIterativeCrossValidation

public static void doIterativeCrossValidation(RatingPredictor recommender,
                                              ISplit<IRatings> split,
                                              int max_iter,
                                              java.lang.Integer find_iter)
                                       throws java.lang.Exception
Evaluate an iterative recommender on the folds of a dataset split, display results on STDOUT.

Parameters:
recommender - a rating predictor
split - a rating dataset split
max_iter - the maximum number of iterations
find_iter - the report interval
Throws:
java.lang.Exception