Class 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.
    • 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 computed
        params - 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 computed
        threshold - 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 class QualityMeasure
        Parameters:
        testUser - TestUser for which the quality measure score is computed
        predictions - Prediction value for the test items rated by the test user
        Returns:
        Quality measure score