Class KEvalMetric

    • Constructor Detail

      • KEvalMetric

        public KEvalMetric()
      • KEvalMetric

        public KEvalMetric​(int k)
    • Method Detail

      • computeEvalMetric

        public double computeEvalMetric​(SimpleSimilarityResult groundTruthRankingResult,
                                        SimpleSimilarityResult predictedRankingResult)
        Description copied from interface: EvalMetric
        Computes a ranking metric for the complete ranking.
        Specified by:
        computeEvalMetric in interface EvalMetric
        Parameters:
        groundTruthRankingResult - the ground-truth ranking
        predictedRankingResult - the predicted ranking (to analyze)
        Returns:
        a double score
      • getMetricName

        public String getMetricName()
        Description copied from interface: EvalMetric
        Returns a name for the metric to be identified in any string representations.
        Specified by:
        getMetricName in interface EvalMetric
        Returns:
        the name of the metric
      • getK

        public int getK()
      • setK

        public void setK​(int k)
      • computeEvalKMetric

        public abstract double computeEvalKMetric​(SimpleSimilarityResult groundTruthRankingResult,
                                                  SimpleSimilarityResult predictedRankingResult,
                                                  Integer k)
        Computes a ranking metric for the top-k cases of the ranking results.
        Parameters:
        groundTruthRankingResult - the ground-truth ranking
        predictedRankingResult - the predicted ranking results to analyze
        k - the number of top cases to look at
        Returns:
        a score for the ranking according to this metric