Class Perfect
- java.lang.Object
-
- es.upm.etsisi.cf4j.qualityMeasure.QualityMeasure
-
- es.upm.etsisi.cf4j.qualityMeasure.prediction.Perfect
-
public class Perfect extends QualityMeasure
This class calculates the percentage of perfect predictions. A prediction is considered perfect if and only if the absolute difference between the test rating and the prediction is less or equal than a threshold.
-
-
Field Summary
-
Fields inherited from class es.upm.etsisi.cf4j.qualityMeasure.QualityMeasure
recommender
-
-
Constructor Summary
Constructors Constructor Description Perfect(Recommender recommender, double threshold)
Constructor of the class which basically calls the father's onePerfect(Recommender recommender, Map<String,Object> params)
Constructor from a Map object with the quality measure parameters.
-
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
-
Perfect
public Perfect(Recommender recommender, Map<String,Object> params)
Constructor from a Map object with the quality measure parameters. Map object must contains the following keys:- threshold: double value that defines the allowed threshold to measure if a prediction is perfect or not.
- Parameters:
recommender
- Recommender instance for which the Perfect score are going to be computedparams
- Quality measure's parameters
-
Perfect
public Perfect(Recommender recommender, double threshold)
Constructor of the class which basically calls the father's one- Parameters:
recommender
- Recommender instance for which the perfect score are going to be computedthreshold
- Threshold value to measure if a prediction is perfect or not
-
-
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
-
-