class_docstr: Ranking metric.
class_docstr_tok: ["Ranking","metric","."]
docstr: Compute self.measures on the true and run relevances provided.
docstr_tok: ["Compute","self.measures","on","the","true","and","run","relevances","provided","."]
code: def compute_measures(
      self,
      true_relevances: Dict[str, int],
      run_relevances: Dict[str, int],
      metric_name_suffix="",
  ) -> List[Stat]:
      """Compute self.measures on the true and run relevances provided."""
      # Loop through the measure names and populate the stats list.
      stats: List[Stat] = []
      for evaluator_measure_name in self.measure_names:
          score = self.compute_measure(
              true_relevances, run_relevances, evaluator_measure_name
          )
          metric_name = self.measure_to_metric_name(
              evaluator_measure_name
          )
          stat = Stat(MetricName(metric_name + metric_name_suffix)).add(
              score
          )
          stats.append(stat)
      return stats
  
imports: from dataclasses import dataclass
  from typing import Callable, Dict, List, Tuple, Optional
  import pytrec_eval
  from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_RANKING_BINARY
  from helm.benchmark.adaptation.request_state import RequestState
  from helm.benchmark.adaptation.adapter_spec import AdapterSpec
  from helm.benchmark.scenarios.scenario import unpack_tag, CORRECT_TAG, Reference
  from helm.common.request import RequestResult
  from helm.common.general import binarize_dict
  from .metric import Metric
  from .metric_name import MetricName
  from .metric_service import MetricService
  from .statistic import Stat
label_desc: Use image node_id 16 for calling the RankingMetric obj's underlying member method code with example usage: obj.compute_measures(true_relevances, run_relevances, metric_name_suffix) and returns: stats