class_docstr: Dynamic Classifier Selection (DCS) is an established combination
  framework for classification tasks. The technique was first proposed by Ho
  et al. in 1994 :cite:`ho1994decision` and then extended, under the name
  DCS Local Accuracy, by Woods et al. in 1997 :cite:`woods1997combination`
  to select the most accurate base classifier in a local region.
  The motivation behind this approach is that base classifiers often make
  distinctive errors and over a degree of complementarity. Consequently,
  selectively combining base classifier can result in a performance
  improvement over generic ensembles which use the majority vote of all
  base classifiers.
  
  See :cite:`woods1997combination` for details.
  
  Parameters
  ----------
  base_estimators: list or numpy array (n_estimators,)
      A list of base classifiers.
  
  local_region_size : int, optional (default=30)
      Number of training points to consider in each iteration of the local
      region generation process (30 by default).
  
  threshold : float in (0, 1), optional (default=None)
      Cut-off value to convert scores into binary labels.
  
  pre_fitted : bool, optional (default=False)
      Whether the base classifiers are trained. If True, `fit`
      process may be skipped.
class_docstr_tok: ["Dynamic","Classifier","Selection","(","DCS",")","is","an","established","combination","framework","for","classification","tasks",".","The","technique","was","first","proposed","by","Ho","et","al",".","in","1994",":","cite",":","`","ho1994decision","`","and","then","extended",",","under","the","name","DCS","Local","Accuracy",",","by","Woods","et","al",".","in","1997",":","cite",":","`","woods1997combination","`","to","select","the","most","accurate","base","classifier","in","a","local","region",".","The","motivation","behind","this","approach","is","that","base","classifiers","often","make","distinctive","errors","and","over","a","degree","of","complementarity",".","Consequently",",","selectively","combining","base","classifier","can","result","in","a","performance","improvement","over","generic","ensembles","which","use","the","majority","vote","of","all","base","classifiers",".","See",":","cite",":","`","woods1997combination","`","for","details",".","Parameters","--","--","--","--","--","base_estimators",":","list","or","numpy","array","(","n_estimators",",",")","A","list","of","base","classifiers",".","local_region_size",":","int",",","optional","(","default=30",")","Number","of","training","points","to","consider","in","each","iteration","of","the","local","region","generation","process","(","30","by","default",")",".","threshold",":","float","in","(","0",",","1",")",",","optional","(","default=None",")","Cut-off","value","to","convert","scores","into","binary","labels",".","pre_fitted",":","bool",",","optional","(","default=False",")","Whether","the","base","classifiers","are","trained",".","If","True",",","`","fit","`","process","may","be","skipped","."]
docstr: Fit classifier.
  
  Parameters
  ----------
  X : numpy array of shape (n_samples, n_features)
      The input samples.
  
  y : numpy array of shape (n_samples,), optional (default=None)
      The ground truth of the input samples (labels).
docstr_tok: ["Fit","classifier",".","Parameters","--","--","--","--","--","X",":","numpy","array","of","shape","(","n_samples",",","n_features",")","The","input","samples",".","y",":","numpy","array","of","shape","(","n_samples",",",")",",","optional","(","default=None",")","The","ground","truth","of","the","input","samples","(","labels",")","."]
code: def fit(self, X, y):
      """Fit classifier.
  
      Parameters
      ----------
      X : numpy array of shape (n_samples, n_features)
          The input samples.
  
      y : numpy array of shape (n_samples,), optional (default=None)
          The ground truth of the input samples (labels).
      """
  
      # Validate inputs X and y
      X, y = check_X_y(X, y)
      X = check_array(X)
      check_classification_targets(y)
      self._classes = len(np.unique(y))
      n_samples = X.shape[0]
  
      # save the train ground truth for evaluation purpose
      self.y_train_ = y
  
      # build KDTree out of training subspace
      self.tree_ = KDTree(X)
  
      self.y_train_predicted_ = np.zeros(
          [n_samples, self.n_base_estimators_]
      )
  
      # train all base classifiers on X, and get their local predicted scores
      # iterate over all base classifiers
      for i, clf in enumerate(self.base_estimators):
          clf.fit(X, y)
          self.y_train_predicted_[:, i] = clf.predict(X)
          clf.fitted_ = True
  
      self.fitted_ = True
  
      return
  
file_path: combo/combo/models/classifier_dcs.py
imports: import warnings
  import numpy
  from sklearn.neighbors import KDTree
  from sklearn.metrics import accuracy_score
  from sklearn.utils import check_array
  from sklearn.utils import check_X_y
  from sklearn.utils.validation import check_is_fitted
  from sklearn.utils.multiclass import check_classification_targets
  from pyod.utils.utility import check_parameter
  from .base import BaseAggregator
label_desc: Use image node_id 2 for calling the DCS_LA obj's underlying member method code with example usage: obj.fit(X, y) without return types