class_docstr: Base class for all estimators in scikit-learn
  
  Notes
  -----
  All estimators should specify all the parameters that can be set
  at the class level in their ``__init__`` as explicit keyword
  arguments (no ``*args`` or ``**kwargs``).
docstr: Validate input data and set or check the `n_features_in_` attribute.
  
  Parameters
  ----------
  X : {array-like, sparse matrix, dataframe} of shape                 (n_samples, n_features)
      The input samples.
  y : array-like of shape (n_samples,), default=None
      The targets. If None, `check_array` is called on `X` and
      `check_X_y` is called otherwise.
  reset : bool, default=True
      Whether to reset the `n_features_in_` attribute.
      If False, the input will be checked for consistency with data
      provided when reset was last True.
  validate_separately : False or tuple of dicts, default=False
      Only used if y is not None.
      If False, call validate_X_y(). Else, it must be a tuple of kwargs
      to be used for calling check_array() on X and y respectively.
  **check_params : kwargs
      Parameters passed to :func:`sklearn.utils.check_array` or
      :func:`sklearn.utils.check_X_y`. Ignored if validate_separately
      is not False.
  
  Returns
  -------
  out : {ndarray, sparse matrix} or tuple of these
      The validated input. A tuple is returned if `y` is not None.
docstr_tok: ["Validate","input","data","and","set","or","check","the","`","n_features_in_","`","attribute",".","Parameters","--","--","--","--","--","X",":","{","array-like",",","sparse","matrix",",","dataframe","}","of","shape","(","n_samples",",","n_features",")","The","input","samples",".","y",":","array-like","of","shape","(","n_samples",",",")",",","default=None","The","targets",".","If","None",",","`","check_array","`","is","called","on","`","X","`","and","`","check_X_y","`","is","called","otherwise",".","reset",":","bool",",","default=True","Whether","to","reset","the","`","n_features_in_","`","attribute",".","If","False",",","the","input","will","be","checked","for","consistency","with","data","provided","when","reset","was","last","True",".","validate_separately",":","False","or","tuple","of","dicts",",","default=False","Only","used","if","y","is","not","None",".","If","False",",","call","validate_X_y","(",")",".","Else",",","it","must","be","a","tuple","of","kwargs","to","be","used","for","calling","check_array","(",")","on","X","and","y","respectively",".","*","*","check_params",":","kwargs","Parameters","passed","to",":","func",":","`","sklearn.utils.check_array","`","or",":","func",":","`","sklearn.utils.check_X_y","`",".","Ignored","if","validate_separately","is","not","False",".","Returns","--","--","--","-","out",":","{","ndarray",",","sparse","matrix","}","or","tuple","of","these","The","validated","input",".","A","tuple","is","returned","if","`","y","`","is","not","None","."]
code: def _validate_data(
      self,
      X,
      y=None,
      reset=True,
      validate_separately=False,
      **check_params,
  ):
      """Validate input data and set or check the `n_features_in_` attribute.
  
          Parameters
          ----------
          X : {array-like, sparse matrix, dataframe} of shape \
                  (n_samples, n_features)
              The input samples.
          y : array-like of shape (n_samples,), default=None
              The targets. If None, `check_array` is called on `X` and
              `check_X_y` is called otherwise.
          reset : bool, default=True
              Whether to reset the `n_features_in_` attribute.
              If False, the input will be checked for consistency with data
              provided when reset was last True.
          validate_separately : False or tuple of dicts, default=False
              Only used if y is not None.
              If False, call validate_X_y(). Else, it must be a tuple of kwargs
              to be used for calling check_array() on X and y respectively.
          **check_params : kwargs
              Parameters passed to :func:`sklearn.utils.check_array` or
              :func:`sklearn.utils.check_X_y`. Ignored if validate_separately
              is not False.
  
          Returns
          -------
          out : {ndarray, sparse matrix} or tuple of these
              The validated input. A tuple is returned if `y` is not None.
          """
  
      if y is None:
          if self._get_tags()["requires_y"]:
              raise ValueError(
                  f"This {self.__class__.__name__} estimator "
                  f"requires y to be passed, but the target y is None."
              )
          X = check_array(X, **check_params)
          out = X
      else:
          if validate_separately:
              # We need this because some estimators validate X and y
              # separately, and in general, separately calling check_array()
              # on X and y isn't equivalent to just calling check_X_y()
              # :(
              check_X_params, check_y_params = validate_separately
              X = check_array(X, **check_X_params)
              y = check_array(y, **check_y_params)
          else:
              X, y = check_X_y(X, y, **check_params)
          out = X, y
  
      if check_params.get("ensure_2d", True):
          self._check_n_features(X, reset=reset)
  
      return out
  
file_path: cuml/python/cuml/_thirdparty/sklearn/utils/skl_dependencies.py
imports: from cuml.internals.array_sparse import SparseCumlArray
  from ....internals.base import Base
  from ..utils.validation import check_X_y
  from ....thirdparty_adapters import check_array
label_desc: Use image node_id 3 for calling the BaseEstimator obj's underlying member method code with example usage: obj._validate_data(X, y, reset, validate_separately) and returns: out