Class NDCGEvaluation

  • 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 NDCGEvaluation
    extends java.lang.Object
    implements ScoreEvaluation
    Normalized 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.

    Since:
    0.7.5
    Author:
    Erich Schubert
    • Field Detail

    • Constructor Detail

      • NDCGEvaluation

        public NDCGEvaluation()
    • 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
      • computeNDCG

        public static double computeNDCG​(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