class_docstr: Manages issues related to imbalance class examples.
  
  Parameters
  ----------
  datalab:
      The Datalab instance that this issue manager searches for issues in.
  
  threshold:
      Minimum fraction of samples of each class that are present in a dataset without class imbalance.
code: def find_issues(
      self,
      **kwargs,
  ) -> None:
      labels = self.datalab.labels
      K = len(self.datalab.class_names)
      class_probs = np.bincount(labels) / len(labels)
      rarest_class_idx = int(np.argmin(class_probs))
      # solely one class is identified as rarest, ties go to class w smaller integer index
      scores = np.where(
          labels == rarest_class_idx, class_probs[rarest_class_idx], 1
      )
      imbalance_exists = class_probs[
          rarest_class_idx
      ] < self.threshold * (1 / K)
      rarest_class_issue = rarest_class_idx if imbalance_exists else -1
      is_issue_column = labels == rarest_class_issue
      rarest_class_name = self.datalab._label_map.get(
          rarest_class_issue, "NA"
      )
  
      self.issues = pd.DataFrame(
          {
              f"is_{self.issue_name}_issue": is_issue_column,
              self.issue_score_key: scores,
          },
      )
      self.summary = self.make_summary(
          score=class_probs[rarest_class_idx]
      )
      self.info = self.collect_info(
          class_name=rarest_class_name, labels=labels
      )
  
file_path: cleanlab/cleanlab/datalab/internal/issue_manager/imbalance.py
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, ClassVar
  import numpy
  import pandas
  from cleanlab.datalab.internal.issue_manager import IssueManager
label_desc: Use image node_id 2 for calling the ClassImbalanceIssueManager obj's underlying member method code with example usage: obj.find_issues() without return types