Package elki.evaluation.scores
Class DCGEvaluation
- java.lang.Object
-
- elki.evaluation.scores.DCGEvaluation
-
- All Implemented Interfaces:
ScoreEvaluation
@Reference(authors="K. J\u00e4rvelin, J. Kek\u00e4l\u00e4inen", title="Cumulated gain-based evaluation of IR techniques", booktitle="ACM Transactions on Information Systems (TOIS)", url="https://doi.org/10.1145/582415.582418", bibkey="DBLP:journals/tois/JarvelinK02") public class DCGEvaluation extends java.lang.Object implements ScoreEvaluation
Discounted Cumulative Gain.This evaluation metric would be able to use relevance information, but the current implementation is for binary labels only (it is easy to add, but requires API additions or changes).
Reference:
K. Järvelin, J. Kekäläinen
Cumulated gain-based evaluation of IR techniques
ACM Transactions on Information Systems (TOIS)TODO: support weighted ground truth.
TODO: allow using other logarithms than 2?
- Since:
- 0.7.5
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDCGEvaluation.ParParameterization class.-
Nested classes/interfaces inherited from interface elki.evaluation.scores.ScoreEvaluation
ScoreEvaluation.Adapter
-
-
Field Summary
Fields Modifier and Type Field Description static DCGEvaluationSTATICStatic instance
-
Constructor Summary
Constructors Constructor Description DCGEvaluation()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static doublecomputeDCG(ScoreEvaluation.Adapter adapter)Compute the DCG given a set of positive IDs and a sorted list of entries, which may include ties.doubleevaluate(ScoreEvaluation.Adapter adapter)Evaluate a given predicate and iterator.doubleexpected(int pos, int all)Expected score for a random result.static doublemaximum(int pos)Maximum DCG.static doublesumInvLog1p(int s, int e)Compute\sum_{i=s}^e 1/log(1+i)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.evaluation.scores.ScoreEvaluation
evaluate
-
-
-
-
Field Detail
-
STATIC
public static final DCGEvaluation STATIC
Static instance
-
-
Method Detail
-
evaluate
public double evaluate(ScoreEvaluation.Adapter adapter)
Description copied from interface:ScoreEvaluationEvaluate a given predicate and iterator.- Specified by:
evaluatein interfaceScoreEvaluation- Parameters:
adapter- Input data adapter- Returns:
- Score
-
expected
public double expected(int pos, int all)Description copied from interface:ScoreEvaluationExpected score for a random result.- Specified by:
expectedin interfaceScoreEvaluation- Parameters:
pos- Number of positive elementsall- Total number of elements- Returns:
- Expected score
-
sumInvLog1p
public static double sumInvLog1p(int s, int e)Compute\sum_{i=s}^e 1/log(1+i)- Parameters:
s- Start valuee- End value (inclusive!)- Returns:
- Sum
-
computeDCG
public static double computeDCG(ScoreEvaluation.Adapter adapter)
Compute the DCG given a set of positive IDs and a sorted list of entries, which may include ties.- Parameters:
adapter- Adapter for different input data types- Returns:
- area under curve
-
maximum
public static double maximum(int pos)
Maximum DCG.- Parameters:
pos- Number of positive objects- Returns:
- Max
-
-