org.mymedialite.eval
Class Ratings

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

public class Ratings
extends java.lang.Object

Evaluation class for rating prediction.


Method Summary
static double computeCBD(double actual_rating, double prediction, double min_rating, double max_rating)
          Compute the capped binomial deviation (CBD).
static double computeFit(RatingPredictor recommender)
          Computes the RMSE fit of a recommender on the training data.
static RatingPredictionEvaluationResults evaluate(IRatingPredictor recommender, IRatings ratings)
          Evaluates a rating predictor for RMSE, (N)MAE, and CBD.
static java.util.Collection<java.lang.String> getMeasures()
          The evaluation measures for rating prediction offered by the class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMeasures

public static java.util.Collection<java.lang.String> getMeasures()
The evaluation measures for rating prediction offered by the class. See http://recsyswiki.com/wiki/Root_mean_square_error and http://recsyswiki.com/wiki/Mean_absolute_error


evaluate

public static RatingPredictionEvaluationResults evaluate(IRatingPredictor recommender,
                                                         IRatings ratings)
Evaluates a rating predictor for RMSE, (N)MAE, and CBD. See http://recsyswiki.com/wiki/Root_mean_square_error and http://recsyswiki.com/wiki/Mean_absolute_error For NMAE, see the paper by Goldberg et al. For CBD (capped binomial deviance), see http://www.kaggle.com/c/ChessRatings2/Details/Evaluation If the recommender can take time into account, and the rating dataset provides rating times, this information will be used for making rating predictions. Literature: Ken Goldberg, Theresa Roeder, Dhruv Gupta, and Chris Perkins: Eigentaste: A Constant Time Collaborative Filtering Algorithm. Information Retrieval Journal 2001. http://goldberg.berkeley.edu/pubs/eigentaste.pdf

Parameters:
recommender - rating predictor
ratings - Test cases
Returns:
a Dictionary containing the evaluation results

computeCBD

public static double computeCBD(double actual_rating,
                                double prediction,
                                double min_rating,
                                double max_rating)
Compute the capped binomial deviation (CBD). http://www.kaggle.com/c/ChessRatings2/Details/Evaluation

Parameters:
actual_rating - the actual rating
prediction - the predicted rating
min_rating - the lower bound of the rating scale
max_rating - the upper bound of the rating scale
Returns:
The CBD of a given rating and a prediction

computeFit

public static double computeFit(RatingPredictor recommender)
Computes the RMSE fit of a recommender on the training data.

Parameters:
recommender - the rating predictor to evaluate
Returns:
the RMSE on the training data