class_docstr: Aggregates label quality scores across different classes to produce one score per example in multi-label classification tasks.
  
  Parameters
  ----------
  base_scorer:
      The method to compute the label quality scores for each class.
  
      See the documentation for the ClassLabelScorer enum for more details.
  
  aggregator:
      The method to aggregate the label quality scores for each class into a single score for each datapoint.
  
      Defaults to the EMA (exponential moving average) aggregator with forgetting factor ``alpha=0.8``.
  
      See the documentation for the Aggregator class for more details.
  
      See also
      --------
      exponential_moving_average
  
  strict:
      Flag for performing strict validation of the input data.
class_docstr_tok: ["Aggregates","label","quality","scores","across","different","classes","to","produce","one","score","per","example","in","multi-label","classification","tasks",".","Parameters","--","--","--","--","--","base_scorer",":","The","method","to","compute","the","label","quality","scores","for","each","class",".","See","the","documentation","for","the","ClassLabelScorer","enum","for","more","details",".","aggregator",":","The","method","to","aggregate","the","label","quality","scores","for","each","class","into","a","single","score","for","each","datapoint",".","Defaults","to","the","EMA","(","exponential","moving","average",")","aggregator","with","forgetting","factor","``","alpha=0.8","``",".","See","the","documentation","for","the","Aggregator","class","for","more","details",".","See","also","--","--","--","--","exponential_moving_average","strict",":","Flag","for","performing","strict","validation","of","the","input","data","."]
docstr: Computes a quality score for each label in a multi-label classification problem
  based on out-of-sample predicted probabilities.
  For each example, the label quality scores for each class are aggregated into a single overall label quality score.
  
  Parameters
  ----------
  labels:
      A 2D array of shape (n_samples, n_labels) with binary labels.
  
  pred_probs:
      A 2D array of shape (n_samples, n_labels) with predicted probabilities.
  
  kwargs:
      Additional keyword arguments to pass to the base_scorer and the aggregator.
  
  base_scorer_kwargs:
       Keyword arguments to pass to the base_scorer
  
   aggregator_kwargs:
       Additional keyword arguments to pass to the aggregator.
  
  Returns
  -------
  scores:
      A 1D array of shape (n_samples,) with the quality scores for each datapoint.
  
  Examples
  --------
  >>> from cleanlab.internal.multilabel_scorer import MultilabelScorer, ClassLabelScorer
  >>> import numpy as np
  >>> labels = np.array([[0, 1, 0], [1, 0, 1]])
  >>> pred_probs = np.array([[0.1, 0.9, 0.1], [0.4, 0.1, 0.9]])
  >>> scorer = MultilabelScorer()
  >>> scores = scorer(labels, pred_probs)
  >>> scores
  array([0.9, 0.5])
  
  >>> scorer = MultilabelScorer(
  ...     base_scorer = ClassLabelScorer.NORMALIZED_MARGIN,
  ...     aggregator = np.min,  # Use the "worst" label quality score for each example.
  ... )
  >>> scores = scorer(labels, pred_probs)
  >>> scores
  array([0.9, 0.4])
docstr_tok: ["Computes","a","quality","score","for","each","label","in","a","multi-label","classification","problem","based","on","out-of-sample","predicted","probabilities",".","For","each","example",",","the","label","quality","scores","for","each","class","are","aggregated","into","a","single","overall","label","quality","score",".","Parameters","--","--","--","--","--","labels",":","A","2D","array","of","shape","(","n_samples",",","n_labels",")","with","binary","labels",".","pred_probs",":","A","2D","array","of","shape","(","n_samples",",","n_labels",")","with","predicted","probabilities",".","kwargs",":","Additional","keyword","arguments","to","pass","to","the","base_scorer","and","the","aggregator",".","base_scorer_kwargs",":","Keyword","arguments","to","pass","to","the","base_scorer","aggregator_kwargs",":","Additional","keyword","arguments","to","pass","to","the","aggregator",".","Returns","--","--","--","-","scores",":","A","1D","array","of","shape","(","n_samples",",",")","with","the","quality","scores","for","each","datapoint",".","Examples","--","--","--","--",">",">",">","from","cleanlab.internal.multilabel_scorer","import","MultilabelScorer",",","ClassLabelScorer",">",">",">","import","numpy","as","np",">",">",">","labels","=","np.array","(","[","[","0",",","1",",","0","]",",","[","1",",","0",",","1","]","]",")",">",">",">","pred_probs","=","np.array","(","[","[","0.1",",","0.9",",","0.1","]",",","[","0.4",",","0.1",",","0.9","]","]",")",">",">",">","scorer","=","MultilabelScorer","(",")",">",">",">","scores","=","scorer","(","labels",",","pred_probs",")",">",">",">","scores","array","(","[","0.9",",","0.5","]",")",">",">",">","scorer","=","MultilabelScorer","(","...","base_scorer","=","ClassLabelScorer.NORMALIZED_MARGIN",",","...","aggregator","=","np.min",",","#","Use","the","``","worst","''","label","quality","score","for","each","example",".","...",")",">",">",">","scores","=","scorer","(","labels",",","pred_probs",")",">",">",">","scores","array","(","[","0.9",",","0.4","]",")"]
code: def __call__(
      self,
      labels: np.ndarray,
      pred_probs: np.ndarray,
      base_scorer_kwargs: Optional[dict] = None,
      **aggregator_kwargs,
  ) -> np.ndarray:
      """
      Computes a quality score for each label in a multi-label classification problem
      based on out-of-sample predicted probabilities.
      For each example, the label quality scores for each class are aggregated into a single overall label quality score.
  
      Parameters
      ----------
      labels:
          A 2D array of shape (n_samples, n_labels) with binary labels.
  
      pred_probs:
          A 2D array of shape (n_samples, n_labels) with predicted probabilities.
  
      kwargs:
          Additional keyword arguments to pass to the base_scorer and the aggregator.
  
      base_scorer_kwargs:
           Keyword arguments to pass to the base_scorer
  
       aggregator_kwargs:
           Additional keyword arguments to pass to the aggregator.
  
      Returns
      -------
      scores:
          A 1D array of shape (n_samples,) with the quality scores for each datapoint.
  
      Examples
      --------
      >>> from cleanlab.internal.multilabel_scorer import MultilabelScorer, ClassLabelScorer
      >>> import numpy as np
      >>> labels = np.array([[0, 1, 0], [1, 0, 1]])
      >>> pred_probs = np.array([[0.1, 0.9, 0.1], [0.4, 0.1, 0.9]])
      >>> scorer = MultilabelScorer()
      >>> scores = scorer(labels, pred_probs)
      >>> scores
      array([0.9, 0.5])
  
      >>> scorer = MultilabelScorer(
      ...     base_scorer = ClassLabelScorer.NORMALIZED_MARGIN,
      ...     aggregator = np.min,  # Use the "worst" label quality score for each example.
      ... )
      >>> scores = scorer(labels, pred_probs)
      >>> scores
      array([0.9, 0.4])
      """
      if self.strict:
          self._validate_labels_and_pred_probs(labels, pred_probs)
      scores = self.get_class_label_quality_scores(
          labels, pred_probs, base_scorer_kwargs
      )
      return self.aggregate(scores, **aggregator_kwargs)
  
imports: from enum import Enum
  from typing import Callable, Dict, Optional, Union
  import numpy
  from sklearn.model_selection import cross_val_predict
  from cleanlab.internal.multilabel_utils import _is_multilabel, stack_complement
  from cleanlab.internal.label_quality_utils import _subtract_confident_thresholds
  from cleanlab.internal.numerics import softmax
  from cleanlab.rank import get_self_confidence_for_each_label, get_normalized_margin_for_each_label, get_confidence_weighted_entropy_for_each_label
label_desc: Use image node_id 2 for calling the MultilabelScorer obj's underlying member method code with example usage: obj.__call__(labels, pred_probs, base_scorer_kwargs) and returns: self