class_docstr: This class evaluates an Information Retrieval (IR) setting.
  
  Given a set of queries and a large corpus set. It will retrieve for each query the top-k most similar document. It measures
  Mean Reciprocal Rank (MRR), Recall@k, and Normalized Discounted Cumulative Gain (NDCG)
class_docstr_tok: ["This","class","evaluates","an","Information","Retrieval","(","IR",")","setting",".","Given","a","set","of","queries","and","a","large","corpus","set",".","It","will","retrieve","for","each","query","the","top-k","most","similar","document",".","It","measures","Mean","Reciprocal","Rank","(","MRR",")",",","Recall","@","k",",","and","Normalized","Discounted","Cumulative","Gain","(","NDCG",")"]
code: def compute_dcg_at_k(relevances, k):
      dcg = 0
      for i in range(min(len(relevances), k)):
          dcg += relevances[i] / np.log2(
              i + 2
          )  # +2 as we start our idx at 0
      return dcg
  
file_path: sentence-transformers/sentence_transformers/evaluation/InformationRetrievalEvaluator.py
imports: from .None import SentenceEvaluator
  import torch
  from torch import Tensor
  import logging
  from tqdm import trange
  from ..util import cos_sim, dot_score
  import os
  import numpy
  from typing import List, Dict, Set, Callable
  import heapq
label_desc: Use image node_id 6 for calling the InformationRetrievalEvaluator obj's underlying member method code with example usage: obj.compute_dcg_at_k(relevances, k) and returns: dcg