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.
docstr: Predicts the posterior probabilities of the corresponding
  query sample. Returns the probability estimates of each class.
  
  Parameters
  ----------
  predictions : array of shape (n_samples, n_classifiers)
      Predictions of the base classifiers for all test examples
  
  probabilities : array of shape (n_samples, n_classifiers, n_classes)
      The predictions of each base classifier for all samples (For
      methods that always require probabilities from the base
      classifiers).
  
  neighbors : array of shape (n_samples, n_neighbors)
      Indices of the k nearest neighbors.
  distances : array of shape (n_samples, n_neighbors)
      Distances from the k nearest neighbors to the query
  
  DFP_mask : array of shape (n_samples, n_classifiers)
     Mask containing 1 for the selected base classifier and 0 otherwise.
  
  Returns
  -------
  predicted_proba: array of shape (n_samples, n_classes)
      Posterior probabilities estimates for each test example.
docstr_tok: ["Predicts","the","posterior","probabilities","of","the","corresponding","query","sample",".","Returns","the","probability","estimates","of","each","class",".","Parameters","--","--","--","--","--","predictions",":","array","of","shape","(","n_samples",",","n_classifiers",")","Predictions","of","the","base","classifiers","for","all","test","examples","probabilities",":","array","of","shape","(","n_samples",",","n_classifiers",",","n_classes",")","The","predictions","of","each","base","classifier","for","all","samples","(","For","methods","that","always","require","probabilities","from","the","base","classifiers",")",".","neighbors",":","array","of","shape","(","n_samples",",","n_neighbors",")","Indices","of","the","k","nearest","neighbors",".","distances",":","array","of","shape","(","n_samples",",","n_neighbors",")","Distances","from","the","k","nearest","neighbors","to","the","query","DFP_mask",":","array","of","shape","(","n_samples",",","n_classifiers",")","Mask","containing","1","for","the","selected","base","classifier","and","0","otherwise",".","Returns","--","--","--","-","predicted_proba",":","array","of","shape","(","n_samples",",","n_classes",")","Posterior","probabilities","estimates","for","each","test","example","."]
code: def predict_proba_with_ds(
      self,
      predictions,
      probabilities,
      neighbors=None,
      distances=None,
      DFP_mask=None,
  ):
      """Predicts the posterior probabilities of the corresponding
      query sample. Returns the probability estimates of each class.
  
      Parameters
      ----------
      predictions : array of shape (n_samples, n_classifiers)
          Predictions of the base classifiers for all test examples
  
      probabilities : array of shape (n_samples, n_classifiers, n_classes)
          The predictions of each base classifier for all samples (For
          methods that always require probabilities from the base
          classifiers).
  
      neighbors : array of shape (n_samples, n_neighbors)
          Indices of the k nearest neighbors.
      distances : array of shape (n_samples, n_neighbors)
          Distances from the k nearest neighbors to the query
  
      DFP_mask : array of shape (n_samples, n_classifiers)
         Mask containing 1 for the selected base classifier and 0 otherwise.
  
      Returns
      -------
      predicted_proba: array of shape (n_samples, n_classes)
          Posterior probabilities estimates for each test example.
      """
      pass
  
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 7 for calling the BaseDS obj's underlying member method code with example usage: obj.predict_proba_with_ds(predictions, probabilities, neighbors, distances, DFP_mask) without return types