class_docstr: Dummy classifier to test pipelining and meta-estimators.
  
  Checks some property of `X` and `y`in fit / predict.
  This allows testing whether pipelines / cross-validation or metaestimators
  changed the input.
  
  Can also be used to check if `fit_params` are passed correctly, and
  to force a certain score to be returned.
  
  Parameters
  ----------
  check_y, check_X : callable, default=None
      The callable used to validate `X` and `y`. These callable should return
      a bool where `False` will trigger an `AssertionError`. If `None`, the
      data is not validated. Default is `None`.
  
  check_y_params, check_X_params : dict, default=None
      The optional parameters to pass to `check_X` and `check_y`. If `None`,
      then no parameters are passed in.
  
  methods_to_check : "all" or list of str, default="all"
      The methods in which the checks should be applied. By default,
      all checks will be done on all methods (`fit`, `predict`,
      `predict_proba`, `decision_function` and `score`).
  
  foo_param : int, default=0
      A `foo` param. When `foo > 1`, the output of :meth:`score` will be 1
      otherwise it is 0.
  
  expected_sample_weight : bool, default=False
      Whether to check if a valid `sample_weight` was passed to `fit`.
  
  expected_fit_params : list of str, default=None
      A list of the expected parameters given when calling `fit`.
  
  Attributes
  ----------
  classes_ : int
      The classes seen during `fit`.
  
  n_features_in_ : int
      The number of features seen during `fit`.
  
  Examples
  --------
  >>> from sklearn.utils._mocking import CheckingClassifier
  
  This helper allow to assert to specificities regarding `X` or `y`. In this
  case we expect `check_X` or `check_y` to return a boolean.
  
  >>> from sklearn.datasets import load_iris
  >>> X, y = load_iris(return_X_y=True)
  >>> clf = CheckingClassifier(check_X=lambda x: x.shape == (150, 4))
  >>> clf.fit(X, y)
  CheckingClassifier(...)
  
  We can also provide a check which might raise an error. In this case, we
  expect `check_X` to return `X` and `check_y` to return `y`.
  
  >>> from sklearn.utils import check_array
  >>> clf = CheckingClassifier(check_X=check_array)
  >>> clf.fit(X, y)
  CheckingClassifier(...)
docstr: Fit classifier.
  
  Parameters
  ----------
  X : array-like of shape (n_samples, n_features)
      Training vector, where `n_samples` is the number of samples and
      `n_features` is the number of features.
  
  y : array-like of shape (n_samples, n_outputs) or (n_samples,),                 default=None
      Target relative to X for classification or regression;
      None for unsupervised learning.
  
  sample_weight : array-like of shape (n_samples,), default=None
      Sample weights. If None, then samples are equally weighted.
  
  **fit_params : dict of string -> object
      Parameters passed to the ``fit`` method of the estimator
  
  Returns
  -------
  self
docstr_tok: ["Fit","classifier",".","Parameters","--","--","--","--","--","X",":","array-like","of","shape","(","n_samples",",","n_features",")","Training","vector",",","where","`","n_samples","`","is","the","number","of","samples","and","`","n_features","`","is","the","number","of","features",".","y",":","array-like","of","shape","(","n_samples",",","n_outputs",")","or","(","n_samples",",",")",",","default=None","Target","relative","to","X","for","classification","or","regression",";","None","for","unsupervised","learning",".","sample_weight",":","array-like","of","shape","(","n_samples",",",")",",","default=None","Sample","weights",".","If","None",",","then","samples","are","equally","weighted",".","*","*","fit_params",":","dict","of","string","-",">","object","Parameters","passed","to","the","``","fit","``","method","of","the","estimator","Returns","--","--","--","-","self"]
code: def fit(self, X, y, sample_weight=None, **fit_params):
      """Fit classifier.
  
          Parameters
          ----------
          X : array-like of shape (n_samples, n_features)
              Training vector, where `n_samples` is the number of samples and
              `n_features` is the number of features.
  
          y : array-like of shape (n_samples, n_outputs) or (n_samples,), \
                  default=None
              Target relative to X for classification or regression;
              None for unsupervised learning.
  
          sample_weight : array-like of shape (n_samples,), default=None
              Sample weights. If None, then samples are equally weighted.
  
          **fit_params : dict of string -> object
              Parameters passed to the ``fit`` method of the estimator
  
          Returns
          -------
          self
          """
      assert _num_samples(X) == _num_samples(y)
      if (
          self.methods_to_check == "all"
          or "fit" in self.methods_to_check
      ):
          X, y = self._check_X_y(X, y, should_be_fitted=False)
      self.n_features_in_ = np.shape(X)[1]
      self.classes_ = np.unique(
          check_array(y, ensure_2d=False, allow_nd=True)
      )
      if self.expected_fit_params:
          missing = set(self.expected_fit_params) - set(fit_params)
          if missing:
              raise AssertionError(
                  f"Expected fit parameter(s) {list(missing)} not seen."
              )
          for key, value in fit_params.items():
              if _num_samples(value) != _num_samples(X):
                  raise AssertionError(
                      f"Fit parameter {key} has length {_num_samples(value)}"
                      f"; expected {_num_samples(X)}."
                  )
      if self.expected_sample_weight:
          if sample_weight is None:
              raise AssertionError(
                  "Expected sample_weight to be passed"
              )
          _check_sample_weight(sample_weight, X)
  
      return self
  
imports: import numpy
  from ..base import BaseEstimator, ClassifierMixin
  from ..utils._metadata_requests import RequestMethod
  from .metaestimators import available_if
  from .validation import _check_sample_weight, _num_samples, check_array, check_is_fitted
label_desc: Use image node_id 3 for calling the CheckingClassifier obj's underlying member method code with example usage: obj.fit(X, y, sample_weight) and returns: self