class_docstr: Main class to compute agreement metrics.
  
  Example:
      >>> import argilla as rg
      >>> from argilla.client.feedback.metrics import AgreementMetric
      >>> metric = AgreementMetric(dataset=dataset, question_name=question, filter_by={"response_status": "submitted"})
      >>> metrics_report = metric.compute("alpha")
class_docstr_tok: ["Main","class","to","compute","agreement","metrics",".","Example",":",">",">",">","import","argilla","as","rg",">",">",">","from","argilla.client.feedback.metrics","import","AgreementMetric",">",">",">","metric","=","AgreementMetric","(","dataset=dataset",",","question_name=question",",","filter_by=","{","``","response_status","''",":","``","submitted","''","}",")",">",">",">","metrics_report","=","metric.compute","(","``","alpha","''",")"]
docstr: Computes the agreement metrics for the given question.
  
  Args:
      metric_names: name or list of names for the metrics to compute. i.e. `alpha`.
      kwargs: additional arguments to pass to the metric.
  
  Raises:
      ValueError: If the metric name is not supported for the given question.
  
  Returns:
      agreement_metrics: A list of `AgreementMetricResult` objects for the dataset.
docstr_tok: ["Computes","the","agreement","metrics","for","the","given","question",".","Args",":","metric_names",":","name","or","list","of","names","for","the","metrics","to","compute",".","i.e",".","`","alpha","`",".","kwargs",":","additional","arguments","to","pass","to","the","metric",".","Raises",":","ValueError",":","If","the","metric","name","is","not","supported","for","the","given","question",".","Returns",":","agreement_metrics",":","A","list","of","`","AgreementMetricResult","`","objects","for","the","dataset","."]
code: def compute(
      self, metric_names: Union[str, List[str]]
  ) -> List[AgreementMetricResult]:
      """Computes the agreement metrics for the given question.
  
      Args:
          metric_names: name or list of names for the metrics to compute. i.e. `alpha`.
          kwargs: additional arguments to pass to the metric.
  
      Raises:
          ValueError: If the metric name is not supported for the given question.
  
      Returns:
          agreement_metrics: A list of `AgreementMetricResult` objects for the dataset.
      """
      metric_names = self._check_metrics(metric_names)
      metric_classes = self._get_metric_classes(metric_names)
  
      dataset = prepare_dataset_for_annotation_task(
          self._dataset,
          self._question_name,
          filter_by=self._filter_by,
          sort_by=self._sort_by,
          max_records=self._max_records,
      )
  
      distance_function = QUESTION_TO_DISTANCE[self._question_type]
  
      metrics = []
      for metric_name, metric_cls in metric_classes:
          metric = metric_cls(
              annotated_dataset=dataset,
              distance_function=distance_function,
          )
          result = metric.compute()
          metrics.append(
              AgreementMetricResult(
                  metric_name=metric_name,
                  result=result,
                  count=len(dataset),
              )
          )
  
      if len(metric_names) == 1:
          return metrics[0]
  
      return metrics
  
file_path: argilla/src/argilla/client/feedback/metrics/agreement_metrics.py
imports: from typing import TYPE_CHECKING, Callable, Dict, List, Optional, Union
  from nltk.metrics.agreement import AnnotationTask
  from nltk.metrics.distance import binary_distance, interval_distance, masi_distance
  from argilla.client.feedback.dataset import FeedbackDataset
  from argilla.client.feedback.metrics.base import AgreementMetricResult, AnnotationTaskMetricBase, MetricBase
  from argilla.client.feedback.schemas import LabelQuestion, MultiLabelQuestion, RankingQuestion, RatingQuestion
  from argilla.client.feedback.schemas.remote.shared import RemoteSchema
label_desc: Use image node_id 2 for calling the AgreementMetric obj's underlying member method code with example usage: obj.compute(metric_names) and returns: metrics, metrics