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: Confidence score.
  
  Parameters
  ----------
  X : array-like of shape (n_samples, n_features)
      The input data.
  
  Returns
  -------
  decision : ndarray of shape (n_samples,) if n_classes == 2                else (n_samples, n_classes)
      Confidence score.
docstr_tok: ["Confidence","score",".","Parameters","--","--","--","--","--","X",":","array-like","of","shape","(","n_samples",",","n_features",")","The","input","data",".","Returns","--","--","--","-","decision",":","ndarray","of","shape","(","n_samples",",",")","if","n_classes","==","2","else","(","n_samples",",","n_classes",")","Confidence","score","."]
code: def decision_function(self, X):
      """Confidence score.
  
          Parameters
          ----------
          X : array-like of shape (n_samples, n_features)
              The input data.
  
          Returns
          -------
          decision : ndarray of shape (n_samples,) if n_classes == 2\
                  else (n_samples, n_classes)
              Confidence score.
          """
      if (
          self.methods_to_check == "all"
          or "decision_function" in self.methods_to_check
      ):
          X, y = self._check_X_y(X)
      if len(self.classes_) == 2:
          # for binary classifier, the confidence score is related to
          # classes_[1] and therefore should be null.
          return np.zeros(_num_samples(X))
      else:
          decision = np.zeros((_num_samples(X), len(self.classes_)))
          decision[:, 0] = 1
          return decision
  
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 6 for calling the CheckingClassifier obj's underlying member method code with example usage: obj.decision_function(X) and returns: np, decision