Class R2
- java.lang.Object
-
- es.upm.etsisi.cf4j.qualityMeasure.QualityMeasure
-
- es.upm.etsisi.cf4j.qualityMeasure.prediction.R2
-
public class R2 extends QualityMeasure
This class calculates the the coefficient of determination, usually denoted as R2, of the predictions performed by a recommender.MSE = (∑(<test item rating> - <test item rating prediction>)2 + (<test item rating> - <getTestRatingAverage>)2) / <number of predictions>
-
-
Field Summary
-
Fields inherited from class es.upm.etsisi.cf4j.qualityMeasure.QualityMeasure
recommender
-
-
Constructor Summary
Constructors Constructor Description R2(Recommender recommender)
Constructor of the class which basically calls the father's one
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getScore(TestUser testUser, double[] predictions)
Computes the quality measure score for a TestUser given the predictions for his/her test ratings-
Methods inherited from class es.upm.etsisi.cf4j.qualityMeasure.QualityMeasure
getScore, getScore
-
-
-
-
Constructor Detail
-
R2
public R2(Recommender recommender)
Constructor of the class which basically calls the father's one- Parameters:
recommender
- Recommender instance for which the R2 are going to be computed
-
-
Method Detail
-
getScore
public double getScore(TestUser testUser, double[] predictions)
Description copied from class:QualityMeasure
Computes the quality measure score for a TestUser given the predictions for his/her test ratings- Specified by:
getScore
in classQualityMeasure
- Parameters:
testUser
- TestUser for which the quality measure score is computedpredictions
- Prediction value for the test items rated by the test user- Returns:
- Quality measure score
-
-