class_docstr: Manages label issues in a Datalab.
  
  Parameters
  ----------
  datalab :
      A Datalab instance.
  
  k :
      The number of nearest neighbors to consider when computing pred_probs from features.
      Only applicable if features are provided and pred_probs are not.
  
  clean_learning_kwargs :
      Keyword arguments to pass to the :py:meth:`CleanLearning <cleanlab.classification.CleanLearning>` constructor.
  
  health_summary_parameters :
      Keyword arguments to pass to the :py:meth:`health_summary <cleanlab.dataset.health_summary>` function.
class_docstr_tok: ["Manages","label","issues","in","a","Datalab",".","Parameters","--","--","--","--","--","datalab",":","A","Datalab","instance",".","k",":","The","number","of","nearest","neighbors","to","consider","when","computing","pred_probs","from","features",".","Only","applicable","if","features","are","provided","and","pred_probs","are","not",".","clean_learning_kwargs",":","Keyword","arguments","to","pass","to","the",":","py",":","meth",":","`","CleanLearning","<","cleanlab.classification.CleanLearning",">","`","constructor",".","health_summary_parameters",":","Keyword","arguments","to","pass","to","the",":","py",":","meth",":","`","health_summary","<","cleanlab.dataset.health_summary",">","`","function","."]
docstr: Find label issues in the datalab.
  
  Parameters
  ----------
  pred_probs :
      The predicted probabilities for each example.
  
  features :
      The features for each example.
docstr_tok: ["Find","label","issues","in","the","datalab",".","Parameters","--","--","--","--","--","pred_probs",":","The","predicted","probabilities","for","each","example",".","features",":","The","features","for","each","example","."]
code: def find_issues(
      self,
      pred_probs: Optional[npt.NDArray] = None,
      features: Optional[npt.NDArray] = None,
      **kwargs,
  ) -> None:
      """Find label issues in the datalab.
  
      Parameters
      ----------
      pred_probs :
          The predicted probabilities for each example.
  
      features :
          The features for each example.
      """
      if pred_probs is None:
          if features is None:
              raise ValueError(
                  "Either pred_probs or features must be provided to find label issues."
              )
          # produce out-of-sample pred_probs from features
          knn = KNeighborsClassifier(n_neighbors=self.k + 1)
          knn.fit(features, self.datalab.labels)
          pred_probs = knn.predict_proba(features)
  
          encoder = OneHotEncoder()
          label_transform = self.datalab.labels.reshape(-1, 1)
          one_hot_label = encoder.fit_transform(label_transform)
  
          # adjust pred_probs so it is out-of-sample
          pred_probs = np.asarray(
              (pred_probs - 1 / (self.k + 1) * one_hot_label)
              * (self.k + 1)
              / self.k
          )
  
      self.health_summary_parameters.update({"pred_probs": pred_probs})
      # Find examples with label issues
      self.issues = self.cl.find_label_issues(
          labels=self.datalab.labels,
          pred_probs=pred_probs,
          **self._process_find_label_issues_kwargs(kwargs),
      )
      self.issues.rename(
          columns={"label_quality": self.issue_score_key}, inplace=True
      )
  
      summary_dict = self.get_health_summary(pred_probs=pred_probs)
  
      # Get a summarized dataframe of the label issues
      self.summary = self.make_summary(
          score=summary_dict["overall_label_health_score"]
      )
  
      # Collect info about the label issues
      self.info = self.collect_info(
          issues=self.issues, summary_dict=summary_dict
      )
  
      # Drop columns from issues that are in the info
      self.issues = self.issues.drop(
          columns=["given_label", "predicted_label"]
      )
  
file_path: cleanlab/cleanlab/datalab/internal/issue_manager/label.py
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Any, ClassVar, Dict, Optional
  from sklearn.neighbors import KNeighborsClassifier
  from sklearn.preprocessing import OneHotEncoder
  import numpy
  from cleanlab.classification import CleanLearning
  from cleanlab.datalab.internal.issue_manager import IssueManager
  from cleanlab.internal.validation import assert_valid_inputs
label_desc: Use image node_id 4 for calling the LabelIssueManager obj's underlying member method code with example usage: obj.find_issues(pred_probs, features) without return types