class_docstr: Aggregation function for multiple metrics.
class_docstr_tok: ["Aggregation","function","for","multiple","metrics","."]
docstr: Initialize the aggregation function.
  
  :param aggfunc: The aggregation function.
  :type aggfunc: callable
  :param labels: The labels.
  :type labels: list
  :param metric: The metric.
  :type metric: str
docstr_tok: ["Initialize","the","aggregation","function",".",":","param","aggfunc",":","The","aggregation","function",".",":","type","aggfunc",":","callable",":","param","labels",":","The","labels",".",":","type","labels",":","list",":","param","metric",":","The","metric",".",":","type","metric",":","str"]
code: def __init__(self, aggfunc, labels, metric):
      """Initialize the aggregation function.
  
      :param aggfunc: The aggregation function.
      :type aggfunc: callable
      :param labels: The labels.
      :type labels: list
      :param metric: The metric.
      :type metric: str
      """
      super(_MultiMetricAggFunc, self).__init__(aggfunc)
      self.num_labels = len(labels)
      if self.num_labels == 2:
          # for binary classification case, choose positive class label
          self.labels = [labels[1]]
      else:
          self.labels = labels
      self.metric = metric
  
imports: import logging
  import math
  import warnings
  from abc import ABC, abstractmethod
  import numpy
  import pandas
  from sklearn.metrics import multilabel_confusion_matrix
  from erroranalysis._internal.cohort_filter import filter_from_cohort
  from erroranalysis._internal.constants import DIFF, PRED_Y, ROW_INDEX, TRUE_Y, MatrixParams, MetricKeys, Metrics, ModelTask, metric_to_display_name
  from erroranalysis._internal.metrics import get_ordered_classes, is_multi_agg_metric, metric_to_func
  from raiutils.exceptions import UserConfigValidationException
label_desc: Use image node_id 1 to create a new _MultiMetricAggFunc object from inherited base classes: _BaseAggFunc with example: obj = _MultiMetricAggFunc(aggfunc, labels, metric)