Class 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
    • Field Detail

      • STATIC

        public static final DCGEvaluation STATIC
        Static instance
    • Constructor Detail

      • DCGEvaluation

        public DCGEvaluation()
    • Method Detail

      • expected

        public double expected​(int pos,
                               int all)
        Description copied from interface: ScoreEvaluation
        Expected score for a random result.
        Specified by:
        expected in interface ScoreEvaluation
        Parameters:
        pos - Number of positive elements
        all - 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 value
        e - 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