code: def common_multilabel_issues(
      labels=list,
      pred_probs=None,
      *,
      class_names=None,
      confident_joint=None,
  ) -> pd.DataFrame:
      """Summarizes which classes in a multi-label dataset appear most often mislabeled overall.
  
      Since classes are not mutually exclusive in multi-label classification, this method summarizes the label issues for each class independently of the others.
  
      Parameters
      ----------
      labels : List[List[int]]
         List of noisy labels for multi-label classification where each example can belong to multiple classes.
         Refer to documentation for this argument in :py:func:`multilabel_classification.filter.find_label_issues <cleanlab.multilabel_classification.filter.find_label_issues>` for further details.
  
      pred_probs : np.ndarray
        An array of shape ``(N, K)`` of model-predicted class probabilities.
        Refer to documentation for this argument in :py:func:`multilabel_classification.filter.find_label_issues <cleanlab.multilabel_classification.filter.find_label_issues>` for further details.
  
      class_names : Iterable[str], optional
          A list or other iterable of the string class names. Its order must match the label indices.
          If class 0 is 'dog' and class 1 is 'cat', then ``class_names = ['dog', 'cat']``.
          If provided, the returned DataFrame will have an extra *Class Name* column with this info.
  
      confident_joint : np.ndarray, optional
         An array of shape ``(K, 2, 2)`` representing a one-vs-rest formatted confident joint.
         Refer to documentation for this argument in :py:func:`multilabel_classification.filter.find_label_issues <cleanlab.multilabel_classification.filter.find_label_issues>` for details.
  
      Returns
      -------
      common_multilabel_issues : pd.DataFrame
          DataFrame where each row corresponds to a class summarized by the following columns:
              - *Class Name*: The name of the class if class_names is provided.
              - *Class Index*: The index of the class.
              - *In Given Label*: Whether the Class is originally annotated True or False in the given label.
              - *In Suggested Label*: Whether the Class should be True or False in the suggested label (based on model's prediction).
              - *Num Examples*: Number of examples flagged as a label issue where this Class is True/False "In Given Label" but cleanlab estimates the annotation should actually be as specified "In Suggested Label". I.e. the number of examples in your dataset where this Class was labeled as True but likely should have been False (or vice versa).
              - *Issue Probability*: The  *Num Examples* column divided by the total number of examples in the dataset; i.e. the relative overall frequency of each type of label issue in your dataset.
  
          By default, the rows in this DataFrame are ordered by "Issue Probability" (descending).
      """
  
      num_examples = _get_num_examples_multilabel(
          labels=labels, confident_joint=confident_joint
      )
      summary_issue_counts = defaultdict(list)
      y_one, num_classes = get_onehot_num_classes(labels, pred_probs)
      (
          label_issues_list,
          labels_list,
          pred_probs_list,
      ) = find_multilabel_issues_per_class(
          labels=labels,
          pred_probs=pred_probs,
          confident_joint=confident_joint,
          return_indices_ranked_by="self_confidence",
      )
  
      for class_num, (label, issues_for_class) in enumerate(
          zip(y_one.T, label_issues_list)
      ):
          binary_label_issues = np.zeros(len(label)).astype(bool)
          binary_label_issues[issues_for_class] = True
          true_but_false_count = sum(
              np.logical_and(label == 1, binary_label_issues)
          )
          false_but_true_count = sum(
              np.logical_and(label == 0, binary_label_issues)
          )
  
          if class_names is not None:
              summary_issue_counts["Class Name"].append(
                  class_names[class_num]
              )
          summary_issue_counts["Class Index"].append(class_num)
          summary_issue_counts["In Given Label"].append(True)
          summary_issue_counts["In Suggested Label"].append(False)
          summary_issue_counts["Num Examples"].append(
              true_but_false_count
          )
          summary_issue_counts["Issue Probability"].append(
              true_but_false_count / num_examples
          )
  
          if class_names is not None:
              summary_issue_counts["Class Name"].append(
                  class_names[class_num]
              )
          summary_issue_counts["Class Index"].append(class_num)
          summary_issue_counts["In Given Label"].append(False)
          summary_issue_counts["In Suggested Label"].append(True)
          summary_issue_counts["Num Examples"].append(
              false_but_true_count
          )
          summary_issue_counts["Issue Probability"].append(
              false_but_true_count / num_examples
          )
      return (
          pd.DataFrame.from_dict(summary_issue_counts)
          .sort_values(by=["Issue Probability"], ascending=False)
          .reset_index(drop=True)
      )
  
file_path: cleanlab/cleanlab/multilabel_classification/dataset.py
imports: import pandas
  import numpy
  from typing import Optional, cast, Dict, Any
  from cleanlab.multilabel_classification.filter import find_multilabel_issues_per_class, find_label_issues
  from cleanlab.internal.multilabel_utils import get_onehot_num_classes
  from collections import defaultdict
label_desc: Use image node_id 1 for calling a global function with example usage: common_multilabel_issues(labels, pred_probs) and returns: pd