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 regression model.
  For regression tasks, this class trains a ``model`` with error-prone, noisy labels
  as if the model had been instead trained on a dataset with perfect labels.
  It achieves this by estimating which labels are noisy (you might solely use CleanLearning for this estimation)
  and then removing examples estimated to have noisy labels, such that a more robust copy of the same model can be
  trained on the remaining clean data.
  
  Parameters
  ----------
  model :
      Any regression model implementing the `sklearn estimator API <https://scikit-learn.org/stable/developers/develop.html#rolling-your-own-estimator>`_,
      defining the following functions:
  
      - ``model.fit(X, y)``
      - ``model.predict(X)``
      - ``model.score(X, y)``
  
      Default model used is `sklearn.linear_model.LinearRegression
      <https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LinearRegression.html>`_.
  
  cv_n_folds :
      This class needs holdout predictions for every data example and if not provided,
      uses cross-validation to compute them. This argument sets the number of cross-validation
      folds used to compute out-of-sample predictions for each example in ``X``. Default is 5.
      Larger values may produce better results, but requires longer to run.
  
  n_boot :
      Number of bootstrap resampling rounds used to estimate the model's epistemic uncertainty.
      Default is 5. Larger values are expected to produce better results but require longer runtimes.
      Set as 0 to skip estimating the epistemic uncertainty and get results faster.
  
  include_aleatoric_uncertainty :
      Specifies if the aleatoric uncertainty should be estimated during label error detection.
      ``True`` by default, which is expected to produce better results but require longer runtimes.
  
  verbose :
      Controls how much output is printed. Set to ``False`` to suppress print statements. Default `False`.
  
  seed :
      Set the default state of the random number generator used to split
      the data. By default, uses ``np.random`` current random state.
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","regression","model",".","For","regression","tasks",",","this","class","trains","a","``","model","``","with","error-prone",",","noisy","labels","as","if","the","model","had","been","instead","trained","on","a","dataset","with","perfect","labels",".","It","achieves","this","by","estimating","which","labels","are","noisy","(","you","might","solely","use","CleanLearning","for","this","estimation",")","and","then","removing","examples","estimated","to","have","noisy","labels",",","such","that","a","more","robust","copy","of","the","same","model","can","be","trained","on","the","remaining","clean","data",".","Parameters","--","--","--","--","--","model",":","Any","regression","model","implementing","the","`","sklearn","estimator","API","<","https",":","\/\/scikit-learn.org\/stable\/developers\/develop.html","#","rolling-your-own-estimator",">","`","_",",","defining","the","following","functions",":","-","``","model.fit","(","X",",","y",")","``","-","``","model.predict","(","X",")","``","-","``","model.score","(","X",",","y",")","``","Default","model","used","is","`","sklearn.linear_model.LinearRegression","<","https",":","\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.linear_model.LinearRegression.html",">","`","_",".","cv_n_folds",":","This","class","needs","holdout","predictions","for","every","data","example","and","if","not","provided",",","uses","cross-validation","to","compute","them",".","This","argument","sets","the","number","of","cross-validation","folds","used","to","compute","out-of-sample","predictions","for","each","example","in","``","X","``",".","Default","is","5",".","Larger","values","may","produce","better","results",",","but","requires","longer","to","run",".","n_boot",":","Number","of","bootstrap","resampling","rounds","used","to","estimate","the","model","'s","epistemic","uncertainty",".","Default","is","5",".","Larger","values","are","expected","to","produce","better","results","but","require","longer","runtimes",".","Set","as","0","to","skip","estimating","the","epistemic","uncertainty","and","get","results","faster",".","include_aleatoric_uncertainty",":","Specifies","if","the","aleatoric","uncertainty","should","be","estimated","during","label","error","detection",".","``","True","``","by","default",",","which","is","expected","to","produce","better","results","but","require","longer","runtimes",".","verbose",":","Controls","how","much","output","is","printed",".","Set","to","``","False","``","to","suppress","print","statements",".","Default","`","False","`",".","seed",":","Set","the","default","state","of","the","random","number","generator","used","to","split","the","data",".","By","default",",","uses","``","np.random","``","current","random","state","."]
code: def __init__(
      self,
      model: Optional[BaseEstimator] = None,
      *,
      cv_n_folds: int = 5,
      n_boot: int = 5,
      include_aleatoric_uncertainty: bool = True,
      verbose: bool = False,
      seed: Optional[bool] = None,
  ):
      if model is None:
          # Use linear regression if no model is provided.
          model = LinearRegression()
  
      # Make sure the given regression model has the appropriate methods defined.
      if not hasattr(model, "fit"):
          raise ValueError("The model must define a .fit() method.")
      if not hasattr(model, "predict"):
          raise ValueError("The model must define a .predict() method.")
  
      if seed is not None:
          np.random.seed(seed=seed)
  
      if n_boot < 0:
          raise ValueError("n_boot cannot be a negative value")
      if cv_n_folds < 2:
          raise ValueError("cv_n_folds must be at least 2")
  
      self.model: BaseEstimator = model
      self.seed: Optional[int] = seed
      self.cv_n_folds: int = cv_n_folds
      self.n_boot: int = n_boot
      self.include_aleatoric_uncertainty: bool = (
          include_aleatoric_uncertainty
      )
      self.verbose: bool = verbose
      self.label_issues_df: Optional[pd.DataFrame] = None
      self.label_issues_mask: Optional[np.ndarray] = None
      self.k: Optional[float] = None
  
imports: from typing import Optional, Union, Tuple
  import inspect
  import warnings
  import math
  import numpy
  import pandas
  import sklearn.base
  from sklearn.base import BaseEstimator
  from sklearn.model_selection import KFold
  from sklearn.linear_model import LinearRegression
  from sklearn.metrics import r2_score
  from cleanlab.typing import LabelLike
  from cleanlab.internal.constants import TINY_VALUE
  from cleanlab.internal.util import train_val_split, subset_X_y
  from cleanlab.internal.regression_utils import assert_valid_regression_inputs
  from cleanlab.internal.validation import labels_to_array
label_desc: Use image node_id 1 to create a new CleanLearning object from inherited base classes: BaseEstimator with example: obj = CleanLearning(model)