class_docstr: Computes NDCG (normalized discounted cumulative gain).
class_docstr_tok: ["Computes","NDCG","(","normalized","discounted","cumulative","gain",")","."]
docstr: Initialize.
  
  Args:
    metric_keys: Metric keys.
    eval_config: Eval config.
    model_name: Model name.
    output_name: Output name.
    example_weighted: True if example weights should be applied.
    query_key: Query key.
    gain_key: Key of feature in features dictionary that holds gain values.
docstr_tok: ["Initialize",".","Args",":","metric_keys",":","Metric","keys",".","eval_config",":","Eval","config",".","model_name",":","Model","name",".","output_name",":","Output","name",".","example_weighted",":","True","if","example","weights","should","be","applied",".","query_key",":","Query","key",".","gain_key",":","Key","of","feature","in","features","dictionary","that","holds","gain","values","."]
code: def __init__(
      self,
      metric_keys: List[metric_types.MetricKey],
      eval_config: Optional[config_pb2.EvalConfig],
      model_name: str,
      output_name: str,
      example_weighted: bool,
      query_key: str,
      gain_key: str,
  ):
      """Initialize.
  
      Args:
        metric_keys: Metric keys.
        eval_config: Eval config.
        model_name: Model name.
        output_name: Output name.
        example_weighted: True if example weights should be applied.
        query_key: Query key.
        gain_key: Key of feature in features dictionary that holds gain values.
      """
      self._metric_keys = metric_keys
      self._eval_config = eval_config
      self._model_name = model_name
      self._output_name = output_name
      self._example_weighted = example_weighted
      self._query_key = query_key
      self._gain_key = gain_key
  
imports: from typing import Dict, Iterable, List, Optional, Tuple, Union
  import apache_beam
  import numpy
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.utils import util
label_desc: Use image node_id 1 to create a new _NDCGCombiner object from inherited base classes: beam with example: obj = _NDCGCombiner(metric_keys, eval_config, model_name, output_name, example_weighted, query_key, gain_key)