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: Clears non-sklearn attributes of this estimator to save space (in-place).
  This includes the DataFrame attribute that stored label issues which may be large for big datasets.
  You may want to call this method before deploying this model (i.e. if you just care about producing predictions).
  After calling this method, certain non-prediction-related attributes/functionality will no longer be available
  (e.g. you cannot call ``self.fit()`` anymore).
docstr_tok: ["Clears","non-sklearn","attributes","of","this","estimator","to","save","space","(","in-place",")",".","This","includes","the","DataFrame","attribute","that","stored","label","issues","which","may","be","large","for","big","datasets",".","You","may","want","to","call","this","method","before","deploying","this","model","(","i.e",".","if","you","just","care","about","producing","predictions",")",".","After","calling","this","method",",","certain","non-prediction-related","attributes\/functionality","will","no","longer","be","available","(","e.g",".","you","can","not","call","``","self.fit","(",")","``","anymore",")","."]
code: def save_space(self):
      """
      Clears non-sklearn attributes of this estimator to save space (in-place).
      This includes the DataFrame attribute that stored label issues which may be large for big datasets.
      You may want to call this method before deploying this model (i.e. if you just care about producing predictions).
      After calling this method, certain non-prediction-related attributes/functionality will no longer be available
      (e.g. you cannot call ``self.fit()`` anymore).
      """
  
      if self.label_issues_df is None and self.verbose:
          print(
              "self.label_issues_df is already empty"
          )  # pragma: no cover
      self.label_issues_df = None
      self.sample_weight = None
      self.label_issues_mask = None
      self.find_label_issues_kwargs = None
      self.label_quality_scores_kwargs = None
      self.confident_joint = None
      self.py = None
      self.ps = None
      self.num_classes = None
      self.noise_matrix = None
      self.inverse_noise_matrix = None
      self.clf_kwargs = None
      self.clf_final_kwargs = None
      if self.verbose:
          print(
              "Deleted non-sklearn attributes such as label_issues_df to save space."
          )
  
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 8 for calling the CleanLearning obj's underlying member method code with example usage: obj.save_space() without return types