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: Set the `n_features_in_` attribute, or check against it.
  
  Parameters
  ----------
  X : {ndarray, sparse matrix} of shape (n_samples, n_features)
      The input samples.
  reset : bool
      If True, the `n_features_in_` attribute is set to `X.shape[1]`.
      Else, the attribute must already exist and the function checks
      that it is equal to `X.shape[1]`.
docstr_tok: ["Set","the","`","n_features_in_","`","attribute",",","or","check","against","it",".","Parameters","--","--","--","--","--","X",":","{","ndarray",",","sparse","matrix","}","of","shape","(","n_samples",",","n_features",")","The","input","samples",".","reset",":","bool","If","True",",","the","`","n_features_in_","`","attribute","is","set","to","`","X.shape","[","1","]","`",".","Else",",","the","attribute","must","already","exist","and","the","function","checks","that","it","is","equal","to","`","X.shape","[","1","]","`","."]
code: def _check_n_features(self, X, reset):
      """Set the `n_features_in_` attribute, or check against it.
  
      Parameters
      ----------
      X : {ndarray, sparse matrix} of shape (n_samples, n_features)
          The input samples.
      reset : bool
          If True, the `n_features_in_` attribute is set to `X.shape[1]`.
          Else, the attribute must already exist and the function checks
          that it is equal to `X.shape[1]`.
      """
      n_features = X.shape[1]
  
      if reset:
          self.n_features_in_ = n_features
      else:
          if not hasattr(self, "n_features_in_"):
              raise RuntimeError(
                  "The reset parameter is False but there is no "
                  "n_features_in_ attribute. Is this estimator fitted?"
              )
          if n_features != self.n_features_in_:
              raise ValueError(
                  "X has {} features, but this {} is expecting {} features "
                  "as input.".format(
                      n_features,
                      self.__class__.__name__,
                      self.n_features_in_,
                  )
              )
  
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 2 for calling the BaseEstimator obj's underlying member method code with example usage: obj._check_n_features(X, reset) without return types