Class KEvalMetric
java.lang.Object
de.uni_trier.wi2.procake.utils.eval.metrics.k.KEvalMetric
- All Implemented Interfaces:
EvalMetric
- Direct Known Subclasses:
HitsMetric
,QualityMuellerMetric
,QualityStromerMetric
Interface for metrics that only look at the top-k cases in the ranking.
- Author:
- Maximilian Hoffmann
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract double
computeEvalKMetric
(SimpleSimilarityResult groundTruthRankingResult, SimpleSimilarityResult predictedRankingResult, Integer k) Computes a ranking metric for the top-k cases of the ranking results.double
computeEvalMetric
(SimpleSimilarityResult groundTruthResult, SimpleSimilarityResult predictedResult) Computes a ranking metric for the complete ranking.int
getK()
Returns a name for the metric to be identified in any string representations.void
setK
(int k)
-
Constructor Details
-
KEvalMetric
public KEvalMetric() -
KEvalMetric
public KEvalMetric(int k)
-
-
Method Details
-
computeEvalMetric
public double computeEvalMetric(SimpleSimilarityResult groundTruthResult, SimpleSimilarityResult predictedResult) Description copied from interface:EvalMetric
Computes a ranking metric for the complete ranking.- Specified by:
computeEvalMetric
in interfaceEvalMetric
- Parameters:
groundTruthResult
- the ground-truth rankingpredictedResult
- the predicted ranking (to analyze)- Returns:
- a double score
-
getMetricName
Description copied from interface:EvalMetric
Returns a name for the metric to be identified in any string representations.- Specified by:
getMetricName
in interfaceEvalMetric
- 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 rankingpredictedRankingResult
- the predicted ranking results to analyzek
- the number of top cases to look at- Returns:
- a score for the ranking according to this metric
-