class_docstr: Computes normalized discounted cumulative gain.
class_docstr_tok: ["Computes","normalized","discounted","cumulative","gain","."]
docstr: Initialize.
  
  Args:
    at_vals: A list containing the number of values to consider in calculating
      the values of nDCG (eg. nDCG@at).
    gain_key: The key in the features dictionary which holds the gain values.
    weight_key: The key in the features dictionary which holds the weights.
      Note that the weight value must be identical across all examples in the
      same query. If set to empty, uses 1.0 instead.
docstr_tok: ["Initialize",".","Args",":","at_vals",":","A","list","containing","the","number","of","values","to","consider","in","calculating","the","values","of","nDCG","(","eg",".","nDCG","@","at",")",".","gain_key",":","The","key","in","the","features","dictionary","which","holds","the","gain","values",".","weight_key",":","The","key","in","the","features","dictionary","which","holds","the","weights",".","Note","that","the","weight","value","must","be","identical","across","all","examples","in","the","same","query",".","If","set","to","empty",",","uses","1.0","instead","."]
code: def __init__(
      self, at_vals: List[int], gain_key: str, weight_key: str
  ):
      """Initialize.
  
      Args:
        at_vals: A list containing the number of values to consider in calculating
          the values of nDCG (eg. nDCG@at).
        gain_key: The key in the features dictionary which holds the gain values.
        weight_key: The key in the features dictionary which holds the weights.
          Note that the weight value must be identical across all examples in the
          same query. If set to empty, uses 1.0 instead.
      """
      self._at_vals = at_vals
      self._gain_key = gain_key
      self._weight_key = weight_key
  
file_path: model-analysis/tensorflow_model_analysis/evaluators/query_metrics/ndcg.py
imports: from typing import Any, Dict, Iterable, List, NamedTuple, Tuple
  import apache_beam
  import numpy
  from tensorflow_model_analysis.evaluators.query_metrics import query_types
  from tensorflow_model_analysis.post_export_metrics import metric_keys
label_desc: Use image node_id 1 to create a new NdcgMetricCombineFn object from inherited base classes: beam with example: obj = NdcgMetricCombineFn(at_vals, gain_key, weight_key)