class_docstr: CleanLearning = Machine Learning with cleaned data (even when training on messy, error-ridden data).
  
  Automated and robust learning with noisy labels using any dataset and any model. This class
  trains a model `clf` with error-prone, noisy labels as if the model had been instead trained
  on a dataset with perfect labels. It achieves this by cleaning out the error and providing
  cleaned data while training. This class is currently intended for standard (multi-class) classification tasks.
  
  Parameters
  ----------
  clf : estimator instance, optional
    A classifier implementing the `sklearn estimator API
    <https://scikit-learn.org/stable/developers/develop.html#rolling-your-own-estimator>`_,
    defining the following functions:
  
    * ``clf.fit(X, y, sample_weight=None)``
    * ``clf.predict_proba(X)``
    * ``clf.predict(X)``
    * ``clf.score(X, y, sample_weight=None)``
  
    See :py:mod:`cleanlab.experimental` for examples of sklearn wrappers,
    e.g. around PyTorch and FastText.
  
    If the model is not sklearn-compatible by default, it might be the case that
    standard packages can adapt the model. For example, you can adapt PyTorch
    models using `skorch <https://skorch.readthedocs.io/>`_ and adapt Keras models
    using `SciKeras <https://www.adriangb.com/scikeras/>`_.
  
    Stores the classifier used in Confident Learning.
    Default classifier used is `sklearn.linear_model.LogisticRegression
    <https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html>`_.
    Default classifier assumes that indexing along the first dimension of the dataset corresponds to
    selecting different training examples.
  
  seed : int, optional
    Set the default state of the random number generator used to split
    the cross-validated folds. By default, uses `np.random` current random state.
  
  cv_n_folds : int, default=5
    This class needs holdout predicted probabilities for every data example
    and if not provided, uses cross-validation to compute them.
    `cv_n_folds` sets the number of cross-validation folds used to compute
    out-of-sample probabilities for each example in `X`.
  
  converge_latent_estimates : bool, optional
    If true, forces numerical consistency of latent estimates. Each is
    estimated independently, but they are related mathematically with closed
    form equivalences. This will iteratively enforce consistency.
  
  pulearning : {None, 0, 1}, default=None
    Only works for 2 class datasets. Set to the integer of the class that is
    perfectly labeled (you are certain that there are no errors in that class).
  
  find_label_issues_kwargs : dict, optional
    Keyword arguments to pass into :py:func:`filter.find_label_issues
    <cleanlab.filter.find_label_issues>`. Particularly useful options include:
    `filter_by`, `frac_noise`, `min_examples_per_class` (which all impact ML accuracy),
    `n_jobs` (set this to 1 to disable multi-processing if it's causing issues).
  
  label_quality_scores_kwargs : dict, optional
    Keyword arguments to pass into :py:func:`rank.get_label_quality_scores
    <cleanlab.rank.get_label_quality_scores>`. Options include: `method`, `adjust_pred_probs`.
  
  verbose : bool, default=False
    Controls how much output is printed. Set to ``False`` to suppress print
    statements.
  
  low_memory: bool, default=False
    Set as ``True`` if you have a big dataset with limited memory.
    Uses :py:func:`experimental.label_issues_batched.find_label_issues_batched <cleanlab.experimental.label_issues_batched>`
    to find label issues.
class_docstr_tok: ["CleanLearning","=","Machine","Learning","with","cleaned","data","(","even","when","training","on","messy",",","error-ridden","data",")",".","Automated","and","robust","learning","with","noisy","labels","using","any","dataset","and","any","model",".","This","class","trains","a","model","`","clf","`","with","error-prone",",","noisy","labels","as","if","the","model","had","been","instead","trained","on","a","dataset","with","perfect","labels",".","It","achieves","this","by","cleaning","out","the","error","and","providing","cleaned","data","while","training",".","This","class","is","currently","intended","for","standard","(","multi-class",")","classification","tasks",".","Parameters","--","--","--","--","--","clf",":","estimator","instance",",","optional","A","classifier","implementing","the","`","sklearn","estimator","API","<","https",":","\/\/scikit-learn.org\/stable\/developers\/develop.html","#","rolling-your-own-estimator",">","`","_",",","defining","the","following","functions",":","*","``","clf.fit","(","X",",","y",",","sample_weight=None",")","``","*","``","clf.predict_proba","(","X",")","``","*","``","clf.predict","(","X",")","``","*","``","clf.score","(","X",",","y",",","sample_weight=None",")","``","See",":","py",":","mod",":","`","cleanlab.experimental","`","for","examples","of","sklearn","wrappers",",","e.g",".","around","PyTorch","and","FastText",".","If","the","model","is","not","sklearn-compatible","by","default",",","it","might","be","the","case","that","standard","packages","can","adapt","the","model",".","For","example",",","you","can","adapt","PyTorch","models","using","`","skorch","<","https",":","\/\/skorch.readthedocs.io\/",">","`","_","and","adapt","Keras","models","using","`","SciKeras","<","https",":","\/\/www.adriangb.com\/scikeras\/",">","`","_",".","Stores","the","classifier","used","in","Confident","Learning",".","Default","classifier","used","is","`","sklearn.linear_model.LogisticRegression","<","https",":","\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.linear_model.LogisticRegression.html",">","`","_",".","Default","classifier","assumes","that","indexing","along","the","first","dimension","of","the","dataset","corresponds","to","selecting","different","training","examples",".","seed",":","int",",","optional","Set","the","default","state","of","the","random","number","generator","used","to","split","the","cross-validated","folds",".","By","default",",","uses","`","np.random","`","current","random","state",".","cv_n_folds",":","int",",","default=5","This","class","needs","holdout","predicted","probabilities","for","every","data","example","and","if","not","provided",",","uses","cross-validation","to","compute","them",".","`","cv_n_folds","`","sets","the","number","of","cross-validation","folds","used","to","compute","out-of-sample","probabilities","for","each","example","in","`","X","`",".","converge_latent_estimates",":","bool",",","optional","If","true",",","forces","numerical","consistency","of","latent","estimates",".","Each","is","estimated","independently",",","but","they","are","related","mathematically","with","closed","form","equivalences",".","This","will","iteratively","enforce","consistency",".","pulearning",":","{","None",",","0",",","1","}",",","default=None","Only","works","for","2","class","datasets",".","Set","to","the","integer","of","the","class","that","is","perfectly","labeled","(","you","are","certain","that","there","are","no","errors","in","that","class",")",".","find_label_issues_kwargs",":","dict",",","optional","Keyword","arguments","to","pass","into",":","py",":","func",":","`","filter.find_label_issues","<","cleanlab.filter.find_label_issues",">","`",".","Particularly","useful","options","include",":","`","filter_by","`",",","`","frac_noise","`",",","`","min_examples_per_class","`","(","which","all","impact","ML","accuracy",")",",","`","n_jobs","`","(","set","this","to","1","to","disable","multi-processing","if","it","'s","causing","issues",")",".","label_quality_scores_kwargs",":","dict",",","optional","Keyword","arguments","to","pass","into",":","py",":","func",":","`","rank.get_label_quality_scores","<","cleanlab.rank.get_label_quality_scores",">","`",".","Options","include",":","`","method","`",",","`","adjust_pred_probs","`",".","verbose",":","bool",",","default=False","Controls","how","much","output","is","printed",".","Set","to","``","False","``","to","suppress","print","statements",".","low_memory",":","bool",",","default=False","Set","as","``","True","``","if","you","have","a","big","dataset","with","limited","memory",".","Uses",":","py",":","func",":","`","experimental.label_issues_batched.find_label_issues_batched","<","cleanlab.experimental.label_issues_batched",">","`","to","find","label","issues","."]
docstr: Identifies potential label issues in the dataset using confident learning.
  
  Runs cross-validation to get out-of-sample pred_probs from `clf`
  and then calls :py:func:`filter.find_label_issues
  <cleanlab.filter.find_label_issues>` to find label issues.
  These label issues are cached internally and returned in a pandas DataFrame.
  Kwargs for :py:func:`filter.find_label_issues
  <cleanlab.filter.find_label_issues>` must have already been specified
  in the initialization of this class, not here.
  
  Unlike :py:func:`filter.find_label_issues
  <cleanlab.filter.find_label_issues>`, which requires `pred_probs`,
  this method only requires a classifier and it can do the cross-validation for you.
  Both methods return the same boolean mask that identifies which examples have label issues.
  This is the preferred method to use if you plan to subsequently invoke:
  `~cleanlab.classification.CleanLearning.fit`.
  
  Note: this method computes the label issues from scratch. To access
  previously-computed label issues from this `~cleanlab.classification.CleanLearning` instance, use the
  `~cleanlab.classification.CleanLearning.get_label_issues` method.
  
  This is the method called to find label issues inside
  `~cleanlab.classification.CleanLearning.fit`
  and they share mostly the same parameters.
  
  Parameters
  ----------
  save_space : bool, optional
    If True, then returned `label_issues_df` will not be stored as attribute.
    This means some other methods like `self.get_label_issues()` will no longer work.
  
  
  For info about the **other parameters**, see the docstring of `~cleanlab.classification.CleanLearning.fit`.
  
  Returns
  -------
  label_issues_df : pd.DataFrame
    DataFrame with info about label issues for each example.
    Unless `save_space` argument is specified, same DataFrame is also stored as
    `self.label_issues_df` attribute accessible via
    `~cleanlab.classification.CleanLearning.get_label_issues`.
    Each row represents an example from our dataset and
    the DataFrame may contain the following columns:
  
    * *is_label_issue*: boolean mask for the entire dataset where ``True`` represents a label issue and ``False`` represents an example that is accurately labeled with high confidence. This column is equivalent to `label_issues_mask` output from :py:func:`filter.find_label_issues<cleanlab.filter.find_label_issues>`.
    * *label_quality*: Numeric score that measures the quality of each label (how likely it is to be correct, with lower scores indicating potentially erroneous labels).
    * *given_label*: Integer indices corresponding to the class label originally given for this example (same as `labels` input). Included here for ease of comparison against `clf` predictions, only present if "predicted_label" column is present.
    * *predicted_label*: Integer indices corresponding to the class predicted by trained `clf` model. Only present if ``pred_probs`` were provided as input or computed during label-issue-finding.
    * *sample_weight*: Numeric values used to weight examples during the final training of `clf` in `~cleanlab.classification.CleanLearning.fit`. This column may not be present after `self.find_label_issues()` but may be added after call to `~cleanlab.classification.CleanLearning.fit`. For more precise definition of sample weights, see documentation of `~cleanlab.classification.CleanLearning.fit`
docstr_tok: ["Identifies","potential","label","issues","in","the","dataset","using","confident","learning",".","Runs","cross-validation","to","get","out-of-sample","pred_probs","from","`","clf","`","and","then","calls",":","py",":","func",":","`","filter.find_label_issues","<","cleanlab.filter.find_label_issues",">","`","to","find","label","issues",".","These","label","issues","are","cached","internally","and","returned","in","a","pandas","DataFrame",".","Kwargs","for",":","py",":","func",":","`","filter.find_label_issues","<","cleanlab.filter.find_label_issues",">","`","must","have","already","been","specified","in","the","initialization","of","this","class",",","not","here",".","Unlike",":","py",":","func",":","`","filter.find_label_issues","<","cleanlab.filter.find_label_issues",">","`",",","which","requires","`","pred_probs","`",",","this","method","only","requires","a","classifier","and","it","can","do","the","cross-validation","for","you",".","Both","methods","return","the","same","boolean","mask","that","identifies","which","examples","have","label","issues",".","This","is","the","preferred","method","to","use","if","you","plan","to","subsequently","invoke",":","`","~cleanlab.classification.CleanLearning.fit","`",".","Note",":","this","method","computes","the","label","issues","from","scratch",".","To","access","previously-computed","label","issues","from","this","`","~cleanlab.classification.CleanLearning","`","instance",",","use","the","`","~cleanlab.classification.CleanLearning.get_label_issues","`","method",".","This","is","the","method","called","to","find","label","issues","inside","`","~cleanlab.classification.CleanLearning.fit","`","and","they","share","mostly","the","same","parameters",".","Parameters","--","--","--","--","--","save_space",":","bool",",","optional","If","True",",","then","returned","`","label_issues_df","`","will","not","be","stored","as","attribute",".","This","means","some","other","methods","like","`","self.get_label_issues","(",")","`","will","no","longer","work",".","For","info","about","the","*","*","other","parameters","*","*",",","see","the","docstring","of","`","~cleanlab.classification.CleanLearning.fit","`",".","Returns","--","--","--","-","label_issues_df",":","pd.DataFrame","DataFrame","with","info","about","label","issues","for","each","example",".","Unless","`","save_space","`","argument","is","specified",",","same","DataFrame","is","also","stored","as","`","self.label_issues_df","`","attribute","accessible","via","`","~cleanlab.classification.CleanLearning.get_label_issues","`",".","Each","row","represents","an","example","from","our","dataset","and","the","DataFrame","may","contain","the","following","columns",":","*","*","is_label_issue","*",":","boolean","mask","for","the","entire","dataset","where","``","True","``","represents","a","label","issue","and","``","False","``","represents","an","example","that","is","accurately","labeled","with","high","confidence",".","This","column","is","equivalent","to","`","label_issues_mask","`","output","from",":","py",":","func",":","`","filter.find_label_issues","<","cleanlab.filter.find_label_issues",">","`",".","*","*","label_quality","*",":","Numeric","score","that","measures","the","quality","of","each","label","(","how","likely","it","is","to","be","correct",",","with","lower","scores","indicating","potentially","erroneous","labels",")",".","*","*","given_label","*",":","Integer","indices","corresponding","to","the","class","label","originally","given","for","this","example","(","same","as","`","labels","`","input",")",".","Included","here","for","ease","of","comparison","against","`","clf","`","predictions",",","only","present","if","``","predicted_label","''","column","is","present",".","*","*","predicted_label","*",":","Integer","indices","corresponding","to","the","class","predicted","by","trained","`","clf","`","model",".","Only","present","if","``","pred_probs","``","were","provided","as","input","or","computed","during","label-issue-finding",".","*","*","sample_weight","*",":","Numeric","values","used","to","weight","examples","during","the","final","training","of","`","clf","`","in","`","~cleanlab.classification.CleanLearning.fit","`",".","This","column","may","not","be","present","after","`","self.find_label_issues","(",")","`","but","may","be","added","after","call","to","`","~cleanlab.classification.CleanLearning.fit","`",".","For","more","precise","definition","of","sample","weights",",","see","documentation","of","`","~cleanlab.classification.CleanLearning.fit","`"]
code: def find_label_issues(
      self,
      X=None,
      labels=None,
      *,
      pred_probs=None,
      thresholds=None,
      noise_matrix=None,
      inverse_noise_matrix=None,
      save_space=False,
      clf_kwargs={},
      validation_func=None,
  ) -> pd.DataFrame:
      """
      Identifies potential label issues in the dataset using confident learning.
  
      Runs cross-validation to get out-of-sample pred_probs from `clf`
      and then calls :py:func:`filter.find_label_issues
      <cleanlab.filter.find_label_issues>` to find label issues.
      These label issues are cached internally and returned in a pandas DataFrame.
      Kwargs for :py:func:`filter.find_label_issues
      <cleanlab.filter.find_label_issues>` must have already been specified
      in the initialization of this class, not here.
  
      Unlike :py:func:`filter.find_label_issues
      <cleanlab.filter.find_label_issues>`, which requires `pred_probs`,
      this method only requires a classifier and it can do the cross-validation for you.
      Both methods return the same boolean mask that identifies which examples have label issues.
      This is the preferred method to use if you plan to subsequently invoke:
      `~cleanlab.classification.CleanLearning.fit`.
  
      Note: this method computes the label issues from scratch. To access
      previously-computed label issues from this `~cleanlab.classification.CleanLearning` instance, use the
      `~cleanlab.classification.CleanLearning.get_label_issues` method.
  
      This is the method called to find label issues inside
      `~cleanlab.classification.CleanLearning.fit`
      and they share mostly the same parameters.
  
      Parameters
      ----------
      save_space : bool, optional
        If True, then returned `label_issues_df` will not be stored as attribute.
        This means some other methods like `self.get_label_issues()` will no longer work.
  
  
      For info about the **other parameters**, see the docstring of `~cleanlab.classification.CleanLearning.fit`.
  
      Returns
      -------
      label_issues_df : pd.DataFrame
        DataFrame with info about label issues for each example.
        Unless `save_space` argument is specified, same DataFrame is also stored as
        `self.label_issues_df` attribute accessible via
        `~cleanlab.classification.CleanLearning.get_label_issues`.
        Each row represents an example from our dataset and
        the DataFrame may contain the following columns:
  
        * *is_label_issue*: boolean mask for the entire dataset where ``True`` represents a label issue and ``False`` represents an example that is accurately labeled with high confidence. This column is equivalent to `label_issues_mask` output from :py:func:`filter.find_label_issues<cleanlab.filter.find_label_issues>`.
        * *label_quality*: Numeric score that measures the quality of each label (how likely it is to be correct, with lower scores indicating potentially erroneous labels).
        * *given_label*: Integer indices corresponding to the class label originally given for this example (same as `labels` input). Included here for ease of comparison against `clf` predictions, only present if "predicted_label" column is present.
        * *predicted_label*: Integer indices corresponding to the class predicted by trained `clf` model. Only present if ``pred_probs`` were provided as input or computed during label-issue-finding.
        * *sample_weight*: Numeric values used to weight examples during the final training of `clf` in `~cleanlab.classification.CleanLearning.fit`. This column may not be present after `self.find_label_issues()` but may be added after call to `~cleanlab.classification.CleanLearning.fit`. For more precise definition of sample weights, see documentation of `~cleanlab.classification.CleanLearning.fit`
      """
  
      # Check inputs
      assert_valid_inputs(X, labels, pred_probs)
      labels = labels_to_array(labels)
      if noise_matrix is not None and np.trace(noise_matrix) <= 1:
          t = np.round(np.trace(noise_matrix), 2)
          raise ValueError(
              "Trace(noise_matrix) is {}, but must exceed 1.".format(t)
          )
      if inverse_noise_matrix is not None and (
          np.trace(inverse_noise_matrix) <= 1
      ):
          t = np.round(np.trace(inverse_noise_matrix), 2)
          raise ValueError(
              "Trace(inverse_noise_matrix) is {}. Must exceed 1.".format(
                  t
              )
          )
  
      if self._default_clf:
          X = force_two_dimensions(X)
      if noise_matrix is not None:
          label_matrix = noise_matrix
      else:
          label_matrix = inverse_noise_matrix
      self.num_classes = get_num_classes(
          labels, pred_probs, label_matrix
      )
      if (pred_probs is None) and (
          len(labels) / self.num_classes < self.cv_n_folds
      ):
          raise ValueError(
              "Need more data from each class for cross-validation. "
              "Try decreasing cv_n_folds (eg. to 2 or 3) in CleanLearning()"
          )
      # 'ps' is p(labels=k)
      self.ps = value_counts(labels) / float(len(labels))
  
      self.clf_kwargs = clf_kwargs
      if self.low_memory:
          # If needed, compute P(label=k|x), denoted pred_probs (the predicted probabilities)
          if pred_probs is None:
              if self.verbose:
                  print(
                      "Computing out of sample predicted probabilities via "
                      f"{self.cv_n_folds}-fold cross validation. May take a while ..."
                  )
  
              pred_probs = estimate_cv_predicted_probabilities(
                  X=X,
                  labels=labels,
                  clf=self.clf,
                  cv_n_folds=self.cv_n_folds,
                  seed=self.seed,
                  clf_kwargs=self.clf_kwargs,
                  validation_func=validation_func,
              )
  
          if self.verbose:
              print(
                  "Using predicted probabilities to identify label issues ..."
              )
  
          if self.find_label_issues_kwargs:
              warnings.warn(
                  f"`find_label_issues_kwargs` is not used when `low_memory=True`."
              )
          arg_values = {
              "thresholds": thresholds,
              "noise_matrix": noise_matrix,
              "inverse_noise_matrix": inverse_noise_matrix,
          }
          for arg_name, arg_val in arg_values.items():
              if arg_val is not None:
                  warnings.warn(
                      f"`{arg_name}` is not used when `low_memory=True`."
                  )
          label_issues_mask = find_label_issues_batched(
              labels, pred_probs, return_mask=True
          )
      else:
          self._process_label_issues_kwargs(
              self.find_label_issues_kwargs
          )
          # self._process_label_issues_kwargs might set self.confident_joint. If so, we should use it.
          if self.confident_joint is not None:
              self.py, noise_matrix, inv_noise_matrix = estimate_latent(
                  confident_joint=self.confident_joint,
                  labels=labels,
              )
  
          # If needed, compute noise rates (probability of class-conditional mislabeling).
          if noise_matrix is not None:
              self.noise_matrix = noise_matrix
              if inverse_noise_matrix is None:
                  if self.verbose:
                      print(
                          "Computing label noise estimates from provided noise matrix ..."
                      )
                  (
                      self.py,
                      self.inverse_noise_matrix,
                  ) = compute_py_inv_noise_matrix(
                      ps=self.ps,
                      noise_matrix=self.noise_matrix,
                  )
          if inverse_noise_matrix is not None:
              self.inverse_noise_matrix = inverse_noise_matrix
              if noise_matrix is None:
                  if self.verbose:
                      print(
                          "Computing label noise estimates from provided inverse noise matrix ..."
                      )
                  self.noise_matrix = compute_noise_matrix_from_inverse(
                      ps=self.ps,
                      inverse_noise_matrix=self.inverse_noise_matrix,
                  )
  
          if noise_matrix is None and inverse_noise_matrix is None:
              if pred_probs is None:
                  if self.verbose:
                      print(
                          "Computing out of sample predicted probabilities via "
                          f"{self.cv_n_folds}-fold cross validation. May take a while ..."
                      )
                  (
                      self.py,
                      self.noise_matrix,
                      self.inverse_noise_matrix,
                      self.confident_joint,
                      pred_probs,
                  ) = estimate_py_noise_matrices_and_cv_pred_proba(
                      X=X,
                      labels=labels,
                      clf=self.clf,
                      cv_n_folds=self.cv_n_folds,
                      thresholds=thresholds,
                      converge_latent_estimates=self.converge_latent_estimates,
                      seed=self.seed,
                      clf_kwargs=self.clf_kwargs,
                      validation_func=validation_func,
                  )
              else:  # pred_probs is provided by user (assumed holdout probabilities)
                  if self.verbose:
                      print(
                          "Computing label noise estimates from provided pred_probs ..."
                      )
                  (
                      self.py,
                      self.noise_matrix,
                      self.inverse_noise_matrix,
                      self.confident_joint,
                  ) = estimate_py_and_noise_matrices_from_probabilities(
                      labels=labels,
                      pred_probs=pred_probs,
                      thresholds=thresholds,
                      converge_latent_estimates=self.converge_latent_estimates,
                  )
          # If needed, compute P(label=k|x), denoted pred_probs (the predicted probabilities)
          if pred_probs is None:
              if self.verbose:
                  print(
                      "Computing out of sample predicted probabilities via "
                      f"{self.cv_n_folds}-fold cross validation. May take a while ..."
                  )
  
              pred_probs = estimate_cv_predicted_probabilities(
                  X=X,
                  labels=labels,
                  clf=self.clf,
                  cv_n_folds=self.cv_n_folds,
                  seed=self.seed,
                  clf_kwargs=self.clf_kwargs,
                  validation_func=validation_func,
              )
          # If needed, compute the confident_joint (e.g. occurs if noise_matrix was given)
          if self.confident_joint is None:
              self.confident_joint = compute_confident_joint(
                  labels=labels,
                  pred_probs=pred_probs,
                  thresholds=thresholds,
              )
  
          # if pulearning == the integer specifying the class without noise.
          if (
              self.num_classes == 2 and self.pulearning is not None
          ):  # pragma: no cover
              # pulearning = 1 (no error in 1 class) implies p(label=1|true_label=0) = 0
              self.noise_matrix[self.pulearning][
                  1 - self.pulearning
              ] = 0
              self.noise_matrix[1 - self.pulearning][
                  1 - self.pulearning
              ] = 1
              # pulearning = 1 (no error in 1 class) implies p(true_label=0|label=1) = 0
              self.inverse_noise_matrix[1 - self.pulearning][
                  self.pulearning
              ] = 0
              self.inverse_noise_matrix[self.pulearning][
                  self.pulearning
              ] = 1
              # pulearning = 1 (no error in 1 class) implies p(label=1,true_label=0) = 0
              self.confident_joint[self.pulearning][
                  1 - self.pulearning
              ] = 0
              self.confident_joint[1 - self.pulearning][
                  1 - self.pulearning
              ] = 1
  
          # Add confident joint to find label issue args if it is not previously specified
          if (
              "confident_joint"
              not in self.find_label_issues_kwargs.keys()
          ):
              # however does not add if users specify filter_by="confident_learning", as it will throw a warning
              if (
                  not self.find_label_issues_kwargs.get("filter_by")
                  == "confident_learning"
              ):
                  self.find_label_issues_kwargs[
                      "confident_joint"
                  ] = self.confident_joint
  
          labels = labels_to_array(labels)
          if self.verbose:
              print(
                  "Using predicted probabilities to identify label issues ..."
              )
          label_issues_mask = filter.find_label_issues(
              labels,
              pred_probs,
              **self.find_label_issues_kwargs,
          )
      label_quality_scores = get_label_quality_scores(
          labels, pred_probs, **self.label_quality_scores_kwargs
      )
      label_issues_df = pd.DataFrame(
          {
              "is_label_issue": label_issues_mask,
              "label_quality": label_quality_scores,
          }
      )
      if self.verbose:
          print(
              f"Identified {np.sum(label_issues_mask)} examples with label issues."
          )
  
      predicted_labels = pred_probs.argmax(axis=1)
      label_issues_df["given_label"] = compress_int_array(
          labels, self.num_classes
      )
      label_issues_df["predicted_label"] = compress_int_array(
          predicted_labels, self.num_classes
      )
  
      if not save_space:
          if self.label_issues_df is not None and self.verbose:
              print(
                  "Overwriting previously identified label issues stored at self.label_issues_df. "
                  "self.get_label_issues() will now return the newly identified label issues. "
              )
          self.label_issues_df = label_issues_df
          self.label_issues_mask = label_issues_df[
              "is_label_issue"
          ]  # pointer to here to avoid duplication
      elif self.verbose:
          print(  # pragma: no cover
              "Not storing label_issues as attributes since save_space was specified."
          )
  
      return label_issues_df
  
imports: from sklearn.linear_model import LogisticRegression
  from sklearn.metrics import accuracy_score
  from sklearn.base import BaseEstimator
  import numpy
  import pandas
  import inspect
  import warnings
  from typing import Optional, TYPE_CHECKING
  from cleanlab.rank import get_label_quality_scores
  from cleanlab import filter
  from cleanlab.internal.util import value_counts, compress_int_array, subset_X_y, get_num_classes, force_two_dimensions
  from cleanlab.count import estimate_py_noise_matrices_and_cv_pred_proba, estimate_py_and_noise_matrices_from_probabilities, estimate_cv_predicted_probabilities, estimate_latent, compute_confident_joint
  from cleanlab.internal.latent_algebra import compute_py_inv_noise_matrix, compute_noise_matrix_from_inverse
  from cleanlab.internal.validation import assert_valid_inputs, labels_to_array
  from cleanlab.experimental.label_issues_batched import find_label_issues_batched
label_desc: Use image node_id 6 for calling the CleanLearning obj's underlying member method code with example usage: obj.find_label_issues(X, labels) and returns: label_issues_df