edu.uci.jforests.eval.ranking
Class RankingEvaluationMetric
- java.lang.Object
-
- edu.uci.jforests.eval.EvaluationMetric
-
- edu.uci.jforests.eval.ranking.RankingEvaluationMetric
-
- Direct Known Subclasses:
- MAPEval, NDCGEval, PrecisionEval, URiskAwareEval
public abstract class RankingEvaluationMetric extends EvaluationMetric
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classRankingEvaluationMetric.SwapScorer
-
Constructor Summary
Constructors Constructor and Description RankingEvaluationMetric(boolean isLargerBetter)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description static double[]computeNaturalOrderScores(int numTargets, int[] boundaries)This gives the ordering of docuuments if they remained in their original orderEvaluationMetricgetParentMetric()abstract RankingEvaluationMetric.SwapScorergetSwapScorer(double[] targets, int[] boundaries, int trunc, int[][] labelCounts)doublemeasure(double[] predictions, Sample sample)abstract double[]measureByQuery(double[] predictions, Sample sample)-
Methods inherited from class edu.uci.jforests.eval.EvaluationMetric
isFirstBetter, largerIsBetter
-
-
-
-
Method Detail
-
computeNaturalOrderScores
public static double[] computeNaturalOrderScores(int numTargets, int[] boundaries)This gives the ordering of docuuments if they remained in their original order- Parameters:
numTargets- how many documents we want in the rankingboundaries- the query offsets- Returns:
- an array with the ranking offsets for each query
-
getSwapScorer
public abstract RankingEvaluationMetric.SwapScorer getSwapScorer(double[] targets, int[] boundaries, int trunc, int[][] labelCounts) throws java.lang.Exception
- Parameters:
targets- Targets of all documents in dataset. Equals Dataset.*.lengthboundaries- Start and end indices of each query within the dataset.trunc- Truncation level for evaluation measurelabelCounts- How many of each label value- Throws:
java.lang.Exception- if things go pear shaped
-
measureByQuery
public abstract double[] measureByQuery(double[] predictions, Sample sample) throws java.lang.Exception- Throws:
java.lang.Exception
-
measure
public double measure(double[] predictions, Sample sample) throws java.lang.Exception- Specified by:
measurein classEvaluationMetric- Throws:
java.lang.Exception
-
getParentMetric
public EvaluationMetric getParentMetric()
-
-
DMelt 3.0 © DataMelt by jWork.ORG