class_docstr: Manages issues related to underperforming group examples.
  
  Note: The `min_cluster_samples` argument should not be confused with the
  `min_samples` argument of sklearn.cluster.DBSCAN.
  
  Examples
  --------
  >>> from cleanlab import Datalab
  >>> import numpy as np
  >>> X = np.random.normal(size=(50, 2))
  >>> y = np.random.randint(2, size=50)
  >>> pred_probs = X / X.sum(axis=1, keepdims=True)
  >>> data = {"X": X, "y": y}
  >>> lab = Datalab(data, label_name="y")
  >>> issue_types={"underperforming_group": {"clustering_kwargs": {"eps": 0.5}}}
  >>> lab.find_issues(pred_probs=pred_probs, features=X, issue_types=issue_types)
class_docstr_tok: ["Manages","issues","related","to","underperforming","group","examples",".","Note",":","The","`","min_cluster_samples","`","argument","should","not","be","confused","with","the","`","min_samples","`","argument","of","sklearn.cluster.DBSCAN",".","Examples","--","--","--","--",">",">",">","from","cleanlab","import","Datalab",">",">",">","import","numpy","as","np",">",">",">","X","=","np.random.normal","(","size=","(","50",",","2",")",")",">",">",">","y","=","np.random.randint","(","2",",","size=50",")",">",">",">","pred_probs","=","X","\/","X.sum","(","axis=1",",","keepdims=True",")",">",">",">","data","=","{","``","X","''",":","X",",","``","y","''",":","y","}",">",">",">","lab","=","Datalab","(","data",",","label_name=","''","y","''",")",">",">",">","issue_types=","{","``","underperforming_group","''",":","{","``","clustering_kwargs","''",":","{","``","eps","''",":","0.5","}","}","}",">",">",">","lab.find_issues","(","pred_probs=pred_probs",",","features=X",",","issue_types=issue_types",")"]
docstr: Get ID and quality score of underperforming cluster.
  
  Args:
      cluster_ids (npt.NDArray[np.int_]): _description_
      unique_cluster_ids (npt.NDArray[np.int_]): _description_
      labels (npt.NDArray): _description_
      pred_probs (npt.NDArray): _description_
  
  Returns:
      Tuple[int, float]: (Underperforming Cluster ID, Cluster Quality Score)
docstr_tok: ["Get","ID","and","quality","score","of","underperforming","cluster",".","Args",":","cluster_ids","(","npt.NDArray","[","np.int_","]",")",":","_description_","unique_cluster_ids","(","npt.NDArray","[","np.int_","]",")",":","_description_","labels","(","npt.NDArray",")",":","_description_","pred_probs","(","npt.NDArray",")",":","_description_","Returns",":","Tuple","[","int",",","float","]",":","(","Underperforming","Cluster","ID",",","Cluster","Quality","Score",")"]
code: def get_worst_cluster(
      self,
      cluster_ids: npt.NDArray[np.int_],
      unique_cluster_ids: npt.NDArray[np.int_],
      labels: npt.NDArray,
      pred_probs: npt.NDArray,
  ) -> Tuple[int, float]:
      """Get ID and quality score of underperforming cluster.
  
      Args:
          cluster_ids (npt.NDArray[np.int_]): _description_
          unique_cluster_ids (npt.NDArray[np.int_]): _description_
          labels (npt.NDArray): _description_
          pred_probs (npt.NDArray): _description_
  
      Returns:
          Tuple[int, float]: (Underperforming Cluster ID, Cluster Quality Score)
      """
      worst_cluster_performance = (
          1  # Largest possible probability value
      )
      worst_cluster_id = min(unique_cluster_ids) - 1
      for cluster_id in unique_cluster_ids:
          cluster_mask = cluster_ids == cluster_id
          cur_cluster_ids = labels[cluster_mask]
          cur_cluster_pred_probs = pred_probs[cluster_mask]
          cluster_performance = get_self_confidence_for_each_label(
              cur_cluster_ids, cur_cluster_pred_probs
          ).mean()
          if cluster_performance < worst_cluster_performance:
              worst_cluster_performance = cluster_performance
              worst_cluster_id = cluster_id
      mean_performance = get_self_confidence_for_each_label(
          labels, pred_probs
      ).mean()
      worst_cluster_ratio = min(
          worst_cluster_performance / mean_performance, 1.0
      )
      worst_cluster_id = (
          worst_cluster_id
          if worst_cluster_ratio < self.threshold
          else self.NO_UNDERPERFORMING_CLUSTER_ID
      )
      return worst_cluster_id, worst_cluster_ratio
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Any, ClassVar, Dict, Optional, Union, Tuple
  import warnings
  import inspect
  import numpy
  import pandas
  from scipy.sparse import csr_matrix
  from sklearn.neighbors import NearestNeighbors
  from sklearn.exceptions import NotFittedError
  from sklearn.utils.validation import check_is_fitted
  from sklearn.cluster import DBSCAN
  from cleanlab.datalab.internal.issue_manager import IssueManager
  from cleanlab.rank import get_self_confidence_for_each_label
label_desc: Use image node_id 6 for calling the UnderperformingGroupIssueManager obj's underlying member method code with example usage: obj.get_worst_cluster(cluster_ids, unique_cluster_ids, labels, pred_probs) and returns: worst_cluster_id,  worst_cluster_ratio