class_docstr: Class for finding label issues in big datasets where memory becomes a problem for other cleanlab methods.
  Only create one such object per dataset and do not try to use the same ``LabelInspector`` across 2 datasets.
  For efficiency, this class does little input checking.
  You can first run :py:func:`filter.find_label_issues <cleanlab.filter.find_label_issues>`
  on a small subset of your data to verify your inputs are properly formatted.
  Do NOT modify any of the attributes of this class yourself!
  Multi-label classification is not supported by this class, it is only for multi-class classification.
  
  The recommended usage demonstrated in the examples script below involves two passes over your data:
  one pass to compute `confident_thresholds`, another to evaluate each label.
  To maximize efficiency, try to use the largest batch_size your memory allows.
  To reduce runtime further, you can run the first pass on a subset of your dataset
  as long as it contains enough data from each class to estimate `confident_thresholds` accurately.
  
  In the examples script below:
  - `labels` is a (big) 1D ``np.ndarray`` of class labels represented as integers in ``0,1,...,K-1``.
  - ``pred_probs`` = is a (big) 2D ``np.ndarray`` of predicted class probabilities,
  where each row is an example, each column represents a class.
  
  `labels` and `pred_probs` can be stored in a file instead where you load chunks of them at a time.
  Methods to load arrays in chunks include: ``np.load(...,mmap_mode='r')``, ``numpy.memmap()``,
  HDF5 or Zarr files, see: https://pythonspeed.com/articles/mmap-vs-zarr-hdf5/
  
  Examples
  --------
  >>> n = len(labels)
  >>> batch_size = 10000  # you can change this in between batches, set as big as your RAM allows
  >>> lab = LabelInspector(num_class = pred_probs.shape[1])
  >>> # First compute confident thresholds (for faster results, can also do this on a random subset of your data):
  >>> i = 0
  >>> while i < n:
  >>>     end_index = i + batch_size
  >>>     labels_batch = labels[i:end_index]
  >>>     pred_probs_batch = pred_probs[i:end_index,:]
  >>>     i = end_index
  >>>     lab.update_confident_thresholds(labels_batch, pred_probs_batch)
  >>> # See what we calculated:
  >>> confident_thresholds = lab.get_confident_thresholds()
  >>> # Evaluate the quality of the labels (run this on full dataset you want to evaluate):
  >>> i = 0
  >>> while i < n:
  >>>     end_index = i + batch_size
  >>>     labels_batch = labels[i:end_index]
  >>>     pred_probs_batch = pred_probs[i:end_index,:]
  >>>     i = end_index
  >>>     batch_results = lab.score_label_quality(labels_batch, pred_probs_batch)
  >>> # Indices of examples with label issues, sorted by label quality score (most severe to least severe):
  >>> indices_of_examples_with_issues = lab.get_label_issues()
  >>> # If your `pred_probs` and `labels` are arrays already in memory,
  >>> # then you can use this shortcut for all of the above:
  >>> indices_of_examples_with_issues = find_label_issues_batched(labels, pred_probs, batch_size=10000)
  
  Parameters
  ----------
  num_class : int
    The number of classes in your multi-class classification task.
  
  store_results : bool, optional
    Whether this object will store all label quality scores, a 1D array of shape ``(N,)``
    where ``N`` is the total number of examples in your dataset.
    Set this to False if you encounter memory problems even for small batch sizes (~1000).
    If ``False``, you can still identify the label issues yourself by aggregating
    the label quality scores for each batch, sorting them across all batches, and returning the top ``T`` indices
    with ``T = self.get_num_issues()``.
  
  verbose : bool, optional
    Whether to suppress print statements or not.
  
  n_jobs: int, optional
    Number of processes for multiprocessing (default value = 1). Only used on Linux.
    If `n_jobs=None`, will use either the number of: physical cores if psutil is installed, or logical cores otherwise.
  
  quality_score_kwargs : dict, optional
    Keyword arguments to pass into :py:func:`rank.get_label_quality_scores <cleanlab.rank.get_label_quality_scores>`.
  
  num_issue_kwargs : dict, optional
    Keyword arguments to :py:func:`count.num_label_issues <cleanlab.count.num_label_issues>`
    to control estimation of the number of label issues.
    The only supported kwarg here for now is: `estimation_method`.
docstr: Fetches already-computed estimate of the number of label issues in the data seen so far
  in the same format as: :py:func:`count.num_label_issues <cleanlab.count.num_label_issues>`.
  
  Note: The estimated number of issues may differ from :py:func:`count.num_label_issues <cleanlab.count.num_label_issues>`
  by 1 due to rounding differences.
  
  Returns
  -------
  num_issues : int
    The estimated number of examples with label issues in the data seen so far.
docstr_tok: ["Fetches","already-computed","estimate","of","the","number","of","label","issues","in","the","data","seen","so","far","in","the","same","format","as",":",":","py",":","func",":","`","count.num_label_issues","<","cleanlab.count.num_label_issues",">","`",".","Note",":","The","estimated","number","of","issues","may","differ","from",":","py",":","func",":","`","count.num_label_issues","<","cleanlab.count.num_label_issues",">","`","by","1","due","to","rounding","differences",".","Returns","--","--","--","-","num_issues",":","int","The","estimated","number","of","examples","with","label","issues","in","the","data","seen","so","far","."]
code: def get_num_issues(self, silent: bool = False) -> int:
      """
      Fetches already-computed estimate of the number of label issues in the data seen so far
      in the same format as: :py:func:`count.num_label_issues <cleanlab.count.num_label_issues>`.
  
      Note: The estimated number of issues may differ from :py:func:`count.num_label_issues <cleanlab.count.num_label_issues>`
      by 1 due to rounding differences.
  
      Returns
      -------
      num_issues : int
        The estimated number of examples with label issues in the data seen so far.
      """
      if self.examples_processed_quality < 1:
          raise ValueError(
              "Have not evaluated any labels yet. Call `score_label_quality()` first."
          )
      else:
          if self.verbose and not silent:
              print(
                  f"Total number of examples whose labels have been evaluated: {self.examples_processed_quality}"
              )
          if self.off_diagonal_calibrated:
              calibrated_prune_counts = (
                  self.prune_counts
                  * self.class_counts
                  / np.clip(
                      self.normalization,
                      a_min=CLIPPING_LOWER_BOUND,
                      a_max=None,
                  )
              )  # avoid division by 0
              return np.rint(np.sum(calibrated_prune_counts)).astype(
                  "int"
              )
          else:  # not calibrated
              return self.prune_count
  
imports: import numpy
  from typing import Optional, List, Tuple, Any
  from cleanlab.count import get_confident_thresholds, _reduce_issues
  from cleanlab.rank import find_top_issues, _compute_label_quality_scores
  from cleanlab.typing import LabelLike
  from cleanlab.internal.util import value_counts_fill_missing_classes
  from cleanlab.internal.constants import CONFIDENT_THRESHOLDS_LOWER_BOUND, FLOATING_POINT_COMPARISON, CLIPPING_LOWER_BOUND
  import platform
  import multiprocessing
label_desc: Use image node_id 3 for calling the LabelInspector obj's underlying member method code with example usage: obj.get_num_issues(silent) and returns: np, self