edu.uci.jforests.eval.ranking
Class NDCGEval
- java.lang.Object
-
- edu.uci.jforests.eval.EvaluationMetric
-
- edu.uci.jforests.eval.ranking.RankingEvaluationMetric
-
- edu.uci.jforests.eval.ranking.NDCGEval
-
public class NDCGEval extends RankingEvaluationMetric
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.uci.jforests.eval.ranking.RankingEvaluationMetric
RankingEvaluationMetric.SwapScorer
-
-
Field Summary
Fields Modifier and Type Field and Description static double[]discountsstatic intGAIN_LEVELSstatic double[]GAINSstatic intMAX_TRUNCATION_LEVEL
-
Constructor Summary
Constructors Constructor and Description NDCGEval(int maxDocsPerQuery, int evalTruncationLevel)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static int[][]getLabelCountsForQueries(double[] labels, int[] boundaries)static double[]getMaxDCGForAllQueriesAtTruncation(double[] labels, int[] boundaries, int trunc, int[][] labelCounts)static double[][]getMaxDCGForAllQueriesUptoTruncation(double[] labels, int[] boundaries, int trunc, int[][] labelCounts)double[]getNDCGatAllTruncations(double[] predictions, Sample sample, ScoreBasedComparator.TieBreaker tieBreaker)double[][]getNDCGatAllTruncationsAllQueries(double[] predictions, Sample sample, ScoreBasedComparator.TieBreaker tieBreaker)RankingEvaluationMetric.SwapScorergetSwapScorer(double[] targets, int[] boundaries, int trunc, int[][] labelCounts)static voidinitialize(int maxDocsPerQuery)doublemeasure(double[] predictions, Sample sample)double[]measureByQuery(double[] predictions, Sample sample)-
Methods inherited from class edu.uci.jforests.eval.ranking.RankingEvaluationMetric
computeNaturalOrderScores, getParentMetric
-
Methods inherited from class edu.uci.jforests.eval.EvaluationMetric
isFirstBetter, largerIsBetter
-
-
-
-
Field Detail
-
MAX_TRUNCATION_LEVEL
public static final int MAX_TRUNCATION_LEVEL
- See Also:
- Constant Field Values
-
GAIN_LEVELS
public static final int GAIN_LEVELS
- See Also:
- Constant Field Values
-
GAINS
public static double[] GAINS
-
discounts
public static double[] discounts
-
-
Constructor Detail
-
NDCGEval
public NDCGEval(int maxDocsPerQuery, int evalTruncationLevel) throws java.lang.Exception- Throws:
java.lang.Exception
-
-
Method Detail
-
initialize
public static void initialize(int maxDocsPerQuery)
-
getLabelCountsForQueries
public static int[][] getLabelCountsForQueries(double[] labels, int[] boundaries)
-
getMaxDCGForAllQueriesUptoTruncation
public static double[][] getMaxDCGForAllQueriesUptoTruncation(double[] labels, int[] boundaries, int trunc, int[][] labelCounts) throws java.lang.Exception- Throws:
java.lang.Exception
-
getMaxDCGForAllQueriesAtTruncation
public static double[] getMaxDCGForAllQueriesAtTruncation(double[] labels, int[] boundaries, int trunc, int[][] labelCounts) throws java.lang.Exception- Throws:
java.lang.Exception
-
getNDCGatAllTruncations
public double[] getNDCGatAllTruncations(double[] predictions, Sample sample, ScoreBasedComparator.TieBreaker tieBreaker) throws java.lang.Exception- Throws:
java.lang.Exception
-
getNDCGatAllTruncationsAllQueries
public double[][] getNDCGatAllTruncationsAllQueries(double[] predictions, Sample sample, ScoreBasedComparator.TieBreaker tieBreaker) throws java.lang.Exception- Throws:
java.lang.Exception
-
measure
public double measure(double[] predictions, Sample sample) throws java.lang.Exception- Overrides:
measurein classRankingEvaluationMetric- Throws:
java.lang.Exception
-
measureByQuery
public double[] measureByQuery(double[] predictions, Sample sample) throws java.lang.Exception- Specified by:
measureByQueryin classRankingEvaluationMetric- Throws:
java.lang.Exception
-
getSwapScorer
public RankingEvaluationMetric.SwapScorer getSwapScorer(double[] targets, int[] boundaries, int trunc, int[][] labelCounts) throws java.lang.Exception
- Specified by:
getSwapScorerin classRankingEvaluationMetric- 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
-
-
DMelt 3.0 © DataMelt by jWork.ORG