class_docstr: Computes normalized discounted cumulative gain.
class_docstr_tok: ["Computes","normalized","discounted","cumulative","gain","."]
code: def extract_output(self, accumulator: _State) -> Dict[str, Any]:
      avg_dict = {}
      for at in self._at_vals:
          if accumulator.weight > 0:
              avg_ndcg = accumulator.ndcg[at] / accumulator.weight
          else:
              avg_ndcg = 0
          avg_dict[metric_keys.base_key("ndcg@%d" % at)] = avg_ndcg
      return avg_dict
  
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 9 for calling the NdcgMetricCombineFn obj's underlying member method code with example usage: obj.extract_output(accumulator) and returns: avg_dict