java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_eval.evaluator.metric.Metric<RankingResult>
de.uni_mannheim.informatik.dws.melt.matching_eval.evaluator.metric.ranking.RankingMetric

public class RankingMetric extends Metric<RankingResult>
A metric which computes multiple rank metrics such as the NDCG and average precision for an execution result.
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • LOG_OF_2

      private static final double LOG_OF_2
    • sameConfidenceRanking

      protected SameConfidenceRanking sameConfidenceRanking
      The strategy to use in case there are multiple correspondences with the same confidence.
    • isKofHitsAtKmanuallySet

      private boolean isKofHitsAtKmanuallySet
      An indicator that determines whether RankingResult.kOfHitsAtK has been manually set. This is important because if it has not been manually set, the value of K for all HITS@K-based KPIs will determined according to the size of the reference alignment.
    • kOfHitsAtK

      private int kOfHitsAtK
      The K of HITS@K. The hits are saved in RankingResult.hitsAtK
  • Constructor Details

    • RankingMetric

      public RankingMetric(SameConfidenceRanking sameConfidenceRanking, int kOfHitsAtK)
      Constructor
      Parameters:
      sameConfidenceRanking - The strategy to use in case there are multiple correspondences with the same confidence.
      kOfHitsAtK - The X of HITS@X.
    • RankingMetric

      public RankingMetric(SameConfidenceRanking sameConfidenceRanking)
      Constructor
      Parameters:
      sameConfidenceRanking - The strategy to use in case there are multiple correspondences with the same confidence.
  • Method Details

    • compute

      protected RankingResult compute(ExecutionResult executionResult)
      Specified by:
      compute in class Metric<RankingResult>
    • computeIDCG

      protected double computeIDCG(int n)
    • getSystemResultReducedToGoldStandardEntities

      protected Alignment getSystemResultReducedToGoldStandardEntities(ExecutionResult executionResult)
      Return the system alignment but only with correspondences where the source or the target appear also in the gold standard.
      Parameters:
      executionResult - execution result to use
      Returns:
      reduced system alignment
    • makeSet

      protected static <T> Set<T> makeSet(Iterable<T> iterable)
    • getAverage

      protected double getAverage(List<Double> list)