class_docstr: Base class for a dynamic classifier selection (dcs) and
     dynamic ensemble selection (des) methods.
  
  All DCS and DES techniques should inherit from this class.
  
  Warning: This class should not be used directly.
  Use derived classes instead.
code: def __init__(
      self,
      pool_classifiers=None,
      k=7,
      DFP=False,
      with_IH=False,
      safe_k=None,
      IH_rate=0.30,
      needs_proba=False,
      random_state=None,
      knn_classifier="knn",
      knn_metric="minkowski",
      DSEL_perc=0.5,
      knne=False,
      n_jobs=-1,
      voting=None,
  ):
      self.pool_classifiers = pool_classifiers
      self.k = k
      self.DFP = DFP
      self.with_IH = with_IH
      self.safe_k = safe_k
      self.IH_rate = IH_rate
      self.needs_proba = needs_proba
      self.random_state = random_state
      self.knn_classifier = knn_classifier
      self.knn_metric = knn_metric
      self.DSEL_perc = DSEL_perc
      self.knne = knne
      self.n_jobs = n_jobs
      self.voting = voting
  
      # Check optional dependency
      if (
          knn_classifier == "faiss"
          and not faiss_knn_wrapper.is_available()
      ):
          raise ImportError(
              'Using knn_classifier="faiss" requires that the FAISS library '
              "be installed.Please check the Installation Guide."
          )
  
imports: import functools
  import math
  import warnings
  from abc import abstractmethod, ABCMeta
  import numpy
  from scipy.stats import mode
  from sklearn.base import BaseEstimator, ClassifierMixin
  from sklearn.ensemble import BaseEnsemble, BaggingClassifier
  from sklearn.model_selection import train_test_split
  from sklearn.neighbors import KNeighborsClassifier
  from sklearn.preprocessing import LabelEncoder, normalize
  from sklearn.utils.validation import check_X_y, check_is_fitted, check_array, check_random_state
  from deslib.util import KNNE
  from deslib.util import faiss_knn_wrapper
  from deslib.util.dfp import frienemy_pruning_preprocessed
  from deslib.util.instance_hardness import hardness_region_competence
label_desc: Use image node_id 1 to create a new BaseDS object from inherited base classes: BaseEstimator, ClassifierMixin with example: obj = BaseDS(pool_classifiers, k, DFP, with_IH, safe_k, IH_rate, needs_proba, random_state, knn_classifier, knn_metric, DSEL_perc, knne, n_jobs, voting)