class_docstr: Normalized Discount Cumulative Gain.
  
  Parameters
  ----------
  k: int or list, optional, default: -1 (all)
      The number of items in the top@k list.
      If None, all items will be considered.
  
  References
  ----------
  https://en.wikipedia.org/wiki/Discounted_cumulative_gain
class_docstr_tok: ["Normalized","Discount","Cumulative","Gain",".","Parameters","--","--","--","--","--","k",":","int","or","list",",","optional",",","default",":","-1","(","all",")","The","number","of","items","in","the","top","@","k","list",".","If","None",",","all","items","will","be","considered",".","References","--","--","--","--","--","https",":","\/\/en.wikipedia.org\/wiki\/Discounted_cumulative_gain"]
docstr: Compute Normalized Discounted Cumulative Gain score.
  
  Parameters
  ----------
  gt_pos: Numpy array
      Vector of positive items.
  
  pd_rank: Numpy array
      Item ranking prediction.
  
  **kwargs: For compatibility
  
  Returns
  -------
  ndcg: A scalar
      Normalized Discounted Cumulative Gain score.
docstr_tok: ["Compute","Normalized","Discounted","Cumulative","Gain","score",".","Parameters","--","--","--","--","--","gt_pos",":","Numpy","array","Vector","of","positive","items",".","pd_rank",":","Numpy","array","Item","ranking","prediction",".","*","*","kwargs",":","For","compatibility","Returns","--","--","--","-","ndcg",":","A","scalar","Normalized","Discounted","Cumulative","Gain","score","."]
code: def compute(self, gt_pos, pd_rank, **kwargs):
      """Compute Normalized Discounted Cumulative Gain score.
  
      Parameters
      ----------
      gt_pos: Numpy array
          Vector of positive items.
  
      pd_rank: Numpy array
          Item ranking prediction.
  
      **kwargs: For compatibility
  
      Returns
      -------
      ndcg: A scalar
          Normalized Discounted Cumulative Gain score.
  
      """
      dcg = self.dcg_score(gt_pos, pd_rank, self.k)
      idcg = self.dcg_score(gt_pos, gt_pos, self.k)
      ndcg = dcg / idcg
  
      return ndcg
  
imports: import numpy
  from scipy.stats import rankdata
label_desc: Use image node_id 3 for calling the NDCG obj's underlying member method code with example usage: obj.compute(gt_pos, pd_rank) and returns: ndcg