class_docstr: Mixin to add functionality to compute the metrics directly from a `FeedbackDataset`.
docstr: Compute metrics for the annotators using the suggestions as the ground truth, and the responses
  as the predicted value, or if a strategy is provided, the same but applied to unified responses.
  
  The metric interpretation is the same whether the responses are unified or not.
  
  Args:
      metric_names: Metric name or list of metric names of the metrics, dependent on the question type.
      question_name: Question for which we want to compute the metrics.
      strategy: Unification strategy. If given, will unify the responses of the dataset and compute
          the metrics on the unified responses vs the suggestions instead on a per user level.
          See `unified_responses` method for more information. Defaults to None.
  
  Note:
      Currently, the following types of questions are supported:
      - For annotator level questions: all the types of questions
      - For unified responses: all the questions except the `TextQuestion`.
  
  Returns:
      metrics_container: If strategy is provided it will unify the annotations and return
          the metrics for the unified responses. Otherwise, it will return the metrics for
          each annotator as a dict, where the key corresponds to the annotator id and the
          values are a list with the metrics.
docstr_tok: ["Compute","metrics","for","the","annotators","using","the","suggestions","as","the","ground","truth",",","and","the","responses","as","the","predicted","value",",","or","if","a","strategy","is","provided",",","the","same","but","applied","to","unified","responses",".","The","metric","interpretation","is","the","same","whether","the","responses","are","unified","or","not",".","Args",":","metric_names",":","Metric","name","or","list","of","metric","names","of","the","metrics",",","dependent","on","the","question","type",".","question_name",":","Question","for","which","we","want","to","compute","the","metrics",".","strategy",":","Unification","strategy",".","If","given",",","will","unify","the","responses","of","the","dataset","and","compute","the","metrics","on","the","unified","responses","vs","the","suggestions","instead","on","a","per","user","level",".","See","`","unified_responses","`","method","for","more","information",".","Defaults","to","None",".","Note",":","Currently",",","the","following","types","of","questions","are","supported",":","-","For","annotator","level","questions",":","all","the","types","of","questions","-","For","unified","responses",":","all","the","questions","except","the","`","TextQuestion","`",".","Returns",":","metrics_container",":","If","strategy","is","provided","it","will","unify","the","annotations","and","return","the","metrics","for","the","unified","responses",".","Otherwise",",","it","will","return","the","metrics","for","each","annotator","as","a","dict",",","where","the","key","corresponds","to","the","annotator","id","and","the","values","are","a","list","with","the","metrics","."]
code: def compute_model_metrics(
      self,
      metric_names: Union[str, List[str]] = None,
      question_name: Union[
          str,
          LabelQuestion,
          MultiLabelQuestion,
          RatingQuestion,
          TextQuestion,
          RankingQuestion,
      ] = None,
      strategy: Optional[
          Union[
              str,
              LabelQuestionStrategy,
              MultiLabelQuestion,
              RatingQuestionStrategy,
              RankingQuestion,
          ]
      ] = None,
  ) -> Union[
      Dict[str, List["ModelMetricResult"]],
      "ModelMetricResult",
      List["ModelMetricResult"],
  ]:
      """Compute metrics for the annotators using the suggestions as the ground truth, and the responses
      as the predicted value, or if a strategy is provided, the same but applied to unified responses.
  
      The metric interpretation is the same whether the responses are unified or not.
  
      Args:
          metric_names: Metric name or list of metric names of the metrics, dependent on the question type.
          question_name: Question for which we want to compute the metrics.
          strategy: Unification strategy. If given, will unify the responses of the dataset and compute
              the metrics on the unified responses vs the suggestions instead on a per user level.
              See `unified_responses` method for more information. Defaults to None.
  
      Note:
          Currently, the following types of questions are supported:
          - For annotator level questions: all the types of questions
          - For unified responses: all the questions except the `TextQuestion`.
  
      Returns:
          metrics_container: If strategy is provided it will unify the annotations and return
              the metrics for the unified responses. Otherwise, it will return the metrics for
              each annotator as a dict, where the key corresponds to the annotator id and the
              values are a list with the metrics.
      """
      from argilla.client.feedback.metrics.annotator_metrics import (
          ModelMetric,
          UnifiedModelMetric,
      )
  
      if strategy:
          self.compute_unified_responses(question_name, strategy)
          return UnifiedModelMetric(self, question_name).compute(
              metric_names
          )
      else:
          return ModelMetric(self, question_name).compute(metric_names)
  
file_path: argilla/src/argilla/client/feedback/dataset/mixins.py
imports: import warnings
  from typing import TYPE_CHECKING, Dict, List, Optional, Union
  from argilla.client.feedback.dataset.base import FeedbackDatasetBase
  from argilla.client.feedback.schemas.questions import LabelQuestion, MultiLabelQuestion, RankingQuestion, RatingQuestion, TextQuestion
  from argilla.client.feedback.unification import LabelQuestionStrategy, MultiLabelQuestionStrategy, RankingQuestionStrategy, RatingQuestionStrategy, TextQuestionStrategy
label_desc: Use image node_id 1 for calling the MetricsMixin obj's underlying member method code with example usage: obj.compute_model_metrics(metric_names, question_name, strategy) and returns: UnifiedModelMetric, ModelMetric