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), default='no validation'
      The input samples.
      If `'no_validation'`, no validation is performed on `X`. This is
      useful for meta-estimator which can delegate input validation to
      their underlying estimator(s). In that case `y` must be passed and
      the only accepted `check_params` are `multi_output` and
      `y_numeric`.
  
  y : array-like of shape (n_samples,), default='no_validation'
      The targets.
  
      - If `None`, `check_array` is called on `X`. If the estimator's
        requires_y tag is True, then an error will be raised.
      - If `'no_validation'`, `check_array` is called on `X` and the
        estimator's requires_y tag is ignored. This is a default
        placeholder and is never meant to be explicitly set. In that case
        `X` must be passed.
      - Otherwise, only `y` with `_check_y` or both `X` and `y` are
        checked with either `check_array` or `check_X_y` depending on
        `validate_separately`.
  
  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.
      .. note::
         It is recommended to call reset=True in `fit` and in the first
         call to `partial_fit`. All other methods that validate `X`
         should set `reset=False`.
  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 both `X` and `y` are
      validated.
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",")",",","default='no","validation'","The","input","samples",".","If","`","'no_validation","'","`",",","no","validation","is","performed","on","`","X","`",".","This","is","useful","for","meta-estimator","which","can","delegate","input","validation","to","their","underlying","estimator","(","s",")",".","In","that","case","`","y","`","must","be","passed","and","the","only","accepted","`","check_params","`","are","`","multi_output","`","and","`","y_numeric","`",".","y",":","array-like","of","shape","(","n_samples",",",")",",","default='no_validation'","The","targets",".","-","If","`","None","`",",","`","check_array","`","is","called","on","`","X","`",".","If","the","estimator's","requires_y","tag","is","True",",","then","an","error","will","be","raised",".","-","If","`","'no_validation","'","`",",","`","check_array","`","is","called","on","`","X","`","and","the","estimator","'s","requires_y","tag","is","ignored",".","This","is","a","default","placeholder","and","is","never","meant","to","be","explicitly","set",".","In","that","case","`","X","`","must","be","passed",".","-","Otherwise",",","only","`","y","`","with","`","_check_y","`","or","both","`","X","`","and","`","y","`","are","checked","with","either","`","check_array","`","or","`","check_X_y","`","depending","on","`","validate_separately","`",".","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",".","..","note",":",":","It","is","recommended","to","call","reset=True","in","`","fit","`","and","in","the","first","call","to","`","partial_fit","`",".","All","other","methods","that","validate","`","X","`","should","set","`","reset=False","`",".","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","both","`","X","`","and","`","y","`","are","validated","."]
code: def _validate_data(
      self,
      X="no_validation",
      y="no_validation",
      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), default='no validation'
              The input samples.
              If `'no_validation'`, no validation is performed on `X`. This is
              useful for meta-estimator which can delegate input validation to
              their underlying estimator(s). In that case `y` must be passed and
              the only accepted `check_params` are `multi_output` and
              `y_numeric`.
  
          y : array-like of shape (n_samples,), default='no_validation'
              The targets.
  
              - If `None`, `check_array` is called on `X`. If the estimator's
                requires_y tag is True, then an error will be raised.
              - If `'no_validation'`, `check_array` is called on `X` and the
                estimator's requires_y tag is ignored. This is a default
                placeholder and is never meant to be explicitly set. In that case
                `X` must be passed.
              - Otherwise, only `y` with `_check_y` or both `X` and `y` are
                checked with either `check_array` or `check_X_y` depending on
                `validate_separately`.
  
          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.
              .. note::
                 It is recommended to call reset=True in `fit` and in the first
                 call to `partial_fit`. All other methods that validate `X`
                 should set `reset=False`.
          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 both `X` and `y` are
              validated.
          """
      self._check_feature_names(X, reset=reset)
  
      if y is None and self._get_tags()["requires_y"]:
          raise ValueError(
              f"This {self.__class__.__name__} estimator "
              "requires y to be passed, but the target y is None."
          )
  
      no_val_X = isinstance(X, str) and X == "no_validation"
      no_val_y = (
          y is None or isinstance(y, str) and y == "no_validation"
      )
  
      if no_val_X and no_val_y:
          raise ValueError("Validation should be done on X, y or both.")
      elif not no_val_X and no_val_y:
          X = check_array(X, **check_params)
          out = X
      elif no_val_X and not no_val_y:
          y = _check_y(y, **check_params)
          out = y
      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 not no_val_X and check_params.get("ensure_2d", True):
          self._check_n_features(X, reset=reset)
  
      return out
  
file_path: dask-ml/dask_ml/base.py
imports: import sklearn.base
  from .utils import _check_y, check_array, check_X_y
label_desc: Use image node_id 1 for calling the DaskMLBaseMixin obj's underlying member method code with example usage: obj._validate_data(X, y, reset, validate_separately) and returns: out