class_docstr: The IssueFinder class is responsible for managing the process of identifying
  issues in the dataset by handling the creation and execution of relevant
  IssueManagers. It serves as a coordinator or helper class for the Datalab class
  to encapsulate the specific behavior of the issue finding process.
  
  At a high level, the IssueFinder is responsible for:
  
  - Determining which types of issues to look for.
  - Instantiating the appropriate IssueManagers using a factory.
  - Running the IssueManagers' `find_issues` methods.
  - Collecting the results into a DataIssues instance.
  
  Parameters
  ----------
  datalab : Datalab
      The Datalab instance associated with this IssueFinder.
  
  task : str
      The type of machine learning task that the dataset is used for.
  
  verbosity : int
      Controls the verbosity of the output during the issue finding process.
  
  Note
  ----
  This class is not intended to be used directly. Instead, use the
  `Datalab.find_issues` method which internally utilizes an IssueFinder instance.
class_docstr_tok: ["The","IssueFinder","class","is","responsible","for","managing","the","process","of","identifying","issues","in","the","dataset","by","handling","the","creation","and","execution","of","relevant","IssueManagers",".","It","serves","as","a","coordinator","or","helper","class","for","the","Datalab","class","to","encapsulate","the","specific","behavior","of","the","issue","finding","process",".","At","a","high","level",",","the","IssueFinder","is","responsible","for",":","-","Determining","which","types","of","issues","to","look","for",".","-","Instantiating","the","appropriate","IssueManagers","using","a","factory",".","-","Running","the","IssueManagers","'","`","find_issues","`","methods",".","-","Collecting","the","results","into","a","DataIssues","instance",".","Parameters","--","--","--","--","--","datalab",":","Datalab","The","Datalab","instance","associated","with","this","IssueFinder",".","task",":","str","The","type","of","machine","learning","task","that","the","dataset","is","used","for",".","verbosity",":","int","Controls","the","verbosity","of","the","output","during","the","issue","finding","process",".","Note","--","--","This","class","is","not","intended","to","be","used","directly",".","Instead",",","use","the","`","Datalab.find_issues","`","method","which","internally","utilizes","an","IssueFinder","instance","."]
docstr: Checks the dataset for all sorts of common issues in real-world data (in both labels and feature values).
  
  You can use Datalab to find issues in your data, utilizing *any* model you have already trained.
  This method only interacts with your model via its predictions or embeddings (and other functions thereof).
  The more of these inputs you provide, the more types of issues Datalab can detect in your dataset/labels.
  If you provide a subset of these inputs, Datalab will output what insights it can based on the limited information from your model.
  
  Note
  ----
  This method is not intended to be used directly. Instead, use the
  :py:meth:`Datalab.find_issues <cleanlab.datalab.datalab.Datalab.find_issues>` method.
  
  Note
  ----
  The issues are saved in the ``self.datalab.data_issues.issues`` attribute, but are not returned.
  
  Parameters
  ----------
  pred_probs :
      Out-of-sample predicted class probabilities made by the model for every example in the dataset.
      To best detect label issues, provide this input obtained from the most accurate model you can produce.
  
      If provided for classification, this must be a 2D array with shape ``(num_examples, K)`` where K is the number of classes in the dataset.
      If provided for regression, this must be a 1D array with shape ``(num_examples,)``.
  
  features : Optional[np.ndarray]
      Feature embeddings (vector representations) of every example in the dataset.
  
      If provided, this must be a 2D array with shape (num_examples, num_features).
  
  knn_graph :
      Sparse matrix representing distances between examples in the dataset in a k nearest neighbor graph.
  
      For details, refer to the documentation of the same argument in :py:class:`Datalab.find_issues <cleanlab.datalab.datalab.Datalab.find_issues>`
  
  issue_types :
      Collection specifying which types of issues to consider in audit and any non-default parameter settings to use.
      If unspecified, a default set of issue types and recommended parameter settings is considered.
  
      This is a dictionary of dictionaries, where the keys are the issue types of interest
      and the values are dictionaries of parameter values that control how each type of issue is detected (only for advanced users).
      More specifically, the values are constructor keyword arguments passed to the corresponding ``IssueManager``,
      which is responsible for detecting the particular issue type.
  
      .. seealso::
          :py:class:`IssueManager <cleanlab.datalab.internal.issue_manager.issue_manager.IssueManager>`
docstr_tok: ["Checks","the","dataset","for","all","sorts","of","common","issues","in","real-world","data","(","in","both","labels","and","feature","values",")",".","You","can","use","Datalab","to","find","issues","in","your","data",",","utilizing","*","any","*","model","you","have","already","trained",".","This","method","only","interacts","with","your","model","via","its","predictions","or","embeddings","(","and","other","functions","thereof",")",".","The","more","of","these","inputs","you","provide",",","the","more","types","of","issues","Datalab","can","detect","in","your","dataset\/labels",".","If","you","provide","a","subset","of","these","inputs",",","Datalab","will","output","what","insights","it","can","based","on","the","limited","information","from","your","model",".","Note","--","--","This","method","is","not","intended","to","be","used","directly",".","Instead",",","use","the",":","py",":","meth",":","`","Datalab.find_issues","<","cleanlab.datalab.datalab.Datalab.find_issues",">","`","method",".","Note","--","--","The","issues","are","saved","in","the","``","self.datalab.data_issues.issues","``","attribute",",","but","are","not","returned",".","Parameters","--","--","--","--","--","pred_probs",":","Out-of-sample","predicted","class","probabilities","made","by","the","model","for","every","example","in","the","dataset",".","To","best","detect","label","issues",",","provide","this","input","obtained","from","the","most","accurate","model","you","can","produce",".","If","provided","for","classification",",","this","must","be","a","2D","array","with","shape","``","(","num_examples",",","K",")","``","where","K","is","the","number","of","classes","in","the","dataset",".","If","provided","for","regression",",","this","must","be","a","1D","array","with","shape","``","(","num_examples",",",")","``",".","features",":","Optional","[","np.ndarray","]","Feature","embeddings","(","vector","representations",")","of","every","example","in","the","dataset",".","If","provided",",","this","must","be","a","2D","array","with","shape","(","num_examples",",","num_features",")",".","knn_graph",":","Sparse","matrix","representing","distances","between","examples","in","the","dataset","in","a","k","nearest","neighbor","graph",".","For","details",",","refer","to","the","documentation","of","the","same","argument","in",":","py",":","class",":","`","Datalab.find_issues","<","cleanlab.datalab.datalab.Datalab.find_issues",">","`","issue_types",":","Collection","specifying","which","types","of","issues","to","consider","in","audit","and","any","non-default","parameter","settings","to","use",".","If","unspecified",",","a","default","set","of","issue","types","and","recommended","parameter","settings","is","considered",".","This","is","a","dictionary","of","dictionaries",",","where","the","keys","are","the","issue","types","of","interest","and","the","values","are","dictionaries","of","parameter","values","that","control","how","each","type","of","issue","is","detected","(","only","for","advanced","users",")",".","More","specifically",",","the","values","are","constructor","keyword","arguments","passed","to","the","corresponding","``","IssueManager","``",",","which","is","responsible","for","detecting","the","particular","issue","type",".","..","seealso",":",":",":","py",":","class",":","`","IssueManager","<","cleanlab.datalab.internal.issue_manager.issue_manager.IssueManager",">","`"]
code: def find_issues(
      self,
      *,
      pred_probs: Optional[np.ndarray] = None,
      features: Optional[npt.NDArray] = None,
      knn_graph: Optional[csr_matrix] = None,
      issue_types: Optional[Dict[str, Any]] = None,
  ) -> None:
      """
      Checks the dataset for all sorts of common issues in real-world data (in both labels and feature values).
  
      You can use Datalab to find issues in your data, utilizing *any* model you have already trained.
      This method only interacts with your model via its predictions or embeddings (and other functions thereof).
      The more of these inputs you provide, the more types of issues Datalab can detect in your dataset/labels.
      If you provide a subset of these inputs, Datalab will output what insights it can based on the limited information from your model.
  
      Note
      ----
      This method is not intended to be used directly. Instead, use the
      :py:meth:`Datalab.find_issues <cleanlab.datalab.datalab.Datalab.find_issues>` method.
  
      Note
      ----
      The issues are saved in the ``self.datalab.data_issues.issues`` attribute, but are not returned.
  
      Parameters
      ----------
      pred_probs :
          Out-of-sample predicted class probabilities made by the model for every example in the dataset.
          To best detect label issues, provide this input obtained from the most accurate model you can produce.
  
          If provided for classification, this must be a 2D array with shape ``(num_examples, K)`` where K is the number of classes in the dataset.
          If provided for regression, this must be a 1D array with shape ``(num_examples,)``.
  
      features : Optional[np.ndarray]
          Feature embeddings (vector representations) of every example in the dataset.
  
          If provided, this must be a 2D array with shape (num_examples, num_features).
  
      knn_graph :
          Sparse matrix representing distances between examples in the dataset in a k nearest neighbor graph.
  
          For details, refer to the documentation of the same argument in :py:class:`Datalab.find_issues <cleanlab.datalab.datalab.Datalab.find_issues>`
  
      issue_types :
          Collection specifying which types of issues to consider in audit and any non-default parameter settings to use.
          If unspecified, a default set of issue types and recommended parameter settings is considered.
  
          This is a dictionary of dictionaries, where the keys are the issue types of interest
          and the values are dictionaries of parameter values that control how each type of issue is detected (only for advanced users).
          More specifically, the values are constructor keyword arguments passed to the corresponding ``IssueManager``,
          which is responsible for detecting the particular issue type.
  
          .. seealso::
              :py:class:`IssueManager <cleanlab.datalab.internal.issue_manager.issue_manager.IssueManager>`
      """
  
      issue_types_copy = self.get_available_issue_types(
          pred_probs=pred_probs,
          features=features,
          knn_graph=knn_graph,
          issue_types=issue_types,
      )
  
      if not issue_types_copy:
          return None
  
      new_issue_managers = [
          factory(
              datalab=self.datalab,
              **issue_types_copy.get(factory.issue_name, {}),
          )
          for factory in _IssueManagerFactory.from_list(
              list(issue_types_copy.keys()), task=self.task
          )
      ]
  
      failed_managers = []
      data_issues = self.datalab.data_issues
      for issue_manager, arg_dict in zip(
          new_issue_managers, issue_types_copy.values()
      ):
          try:
              if self.verbosity:
                  print(
                      f"Finding {issue_manager.issue_name} issues ..."
                  )
              issue_manager.find_issues(**arg_dict)
              data_issues.collect_statistics(issue_manager)
              data_issues.collect_issues_from_issue_manager(
                  issue_manager
              )
          except Exception as e:
              print(f"Error in {issue_manager.issue_name}: {e}")
              failed_managers.append(issue_manager)
      if failed_managers:
          print(
              f"Failed to check for these issue types: {failed_managers}"
          )
      data_issues.set_health_score()
  
file_path: cleanlab/cleanlab/datalab/internal/issue_finder.py
imports: from __future__ import annotations
  import warnings
  from typing import TYPE_CHECKING, Any, Dict, Optional
  import numpy
  from scipy.sparse import csr_matrix
  from cleanlab.datalab.internal.issue_manager_factory import _IssueManagerFactory, list_default_issue_types
  from cleanlab.datalab.internal.model_outputs import MultiClassPredProbs, RegressionPredictions
label_desc: Use image node_id 2 for calling the IssueFinder obj's underlying member method code with example usage: obj.find_issues() and returns: None