class_docstr: Base class for a Dynamic Ensemble Selection (DES).
  
  All dynamic ensemble selection techniques should inherit from this class.
  
  Warning: This class should not be instantiated directly, use
  derived classes instead.
docstr: Predicts the posterior probabilities of the corresponding query.
  
  If self.mode == "selection", the selected ensemble is used to estimate
  the probabilities. The average rule is used
  to give probabilities estimates.
  
  If self.mode == "weighting", all base classifiers are used for
  estimating the probabilities, however their influence in the final
  decision are weighted according to their estimated competence level.
  A weighted average method is used to give the probabilities estimates.
  
  If self.mode == "Hybrid",  A hybrid Dynamic selection and weighting
  approach is used. First an ensemble with the competent base classifiers
  are selected. Then, their decisions are aggregated using a weighted
  average rule to give the probabilities estimates.
  
  Parameters
  ----------
  predictions : array of shape (n_samples, n_classifiers)
      Predictions of the base classifier for all test examples.
  
  probabilities : array of shape (n_samples, n_classifiers, n_classes)
      Probabilities estimates of each base classifier for all samples.
  
  competence_region : 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 = [n_samples, n_classes]
                    The probability estimates for all test examples.
docstr_tok: ["Predicts","the","posterior","probabilities","of","the","corresponding","query",".","If","self.mode","==","``","selection","''",",","the","selected","ensemble","is","used","to","estimate","the","probabilities",".","The","average","rule","is","used","to","give","probabilities","estimates",".","If","self.mode","==","``","weighting","''",",","all","base","classifiers","are","used","for","estimating","the","probabilities",",","however","their","influence","in","the","final","decision","are","weighted","according","to","their","estimated","competence","level",".","A","weighted","average","method","is","used","to","give","the","probabilities","estimates",".","If","self.mode","==","``","Hybrid","''",",","A","hybrid","Dynamic","selection","and","weighting","approach","is","used",".","First","an","ensemble","with","the","competent","base","classifiers","are","selected",".","Then",",","their","decisions","are","aggregated","using","a","weighted","average","rule","to","give","the","probabilities","estimates",".","Parameters","--","--","--","--","--","predictions",":","array","of","shape","(","n_samples",",","n_classifiers",")","Predictions","of","the","base","classifier","for","all","test","examples",".","probabilities",":","array","of","shape","(","n_samples",",","n_classifiers",",","n_classes",")","Probabilities","estimates","of","each","base","classifier","for","all","samples",".","competence_region",":","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","=","[","n_samples",",","n_classes","]","The","probability","estimates","for","all","test","examples","."]
code: def predict_proba_with_ds(
      self,
      predictions,
      probabilities=None,
      competence_region=None,
      distances=None,
      DFP_mask=None,
  ):
      """Predicts the posterior probabilities of the corresponding query.
  
      If self.mode == "selection", the selected ensemble is used to estimate
      the probabilities. The average rule is used
      to give probabilities estimates.
  
      If self.mode == "weighting", all base classifiers are used for
      estimating the probabilities, however their influence in the final
      decision are weighted according to their estimated competence level.
      A weighted average method is used to give the probabilities estimates.
  
      If self.mode == "Hybrid",  A hybrid Dynamic selection and weighting
      approach is used. First an ensemble with the competent base classifiers
      are selected. Then, their decisions are aggregated using a weighted
      average rule to give the probabilities estimates.
  
      Parameters
      ----------
      predictions : array of shape (n_samples, n_classifiers)
          Predictions of the base classifier for all test examples.
  
      probabilities : array of shape (n_samples, n_classifiers, n_classes)
          Probabilities estimates of each base classifier for all samples.
  
      competence_region : 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 = [n_samples, n_classes]
                        The probability estimates for all test examples.
      """
      if self.needs_proba:
          competences = self.estimate_competence_from_proba(
              neighbors=competence_region,
              distances=distances,
              probabilities=probabilities,
          )
      else:
          competences = self.estimate_competence(
              competence_region=competence_region,
              distances=distances,
              predictions=predictions,
          )
      if self.DFP:
          # FIRE-DES pruning.
          competences = competences * DFP_mask
  
      if self.mode == "selection":
          predicted_proba = self._dynamic_selection(
              competences, predictions, probabilities
          )
      elif self.mode == "weighting":
          predicted_proba = self._dynamic_weighting(
              competences, predictions, probabilities
          )
      else:
          predicted_proba = self._hybrid(
              competences, predictions, probabilities
          )
  
      return predicted_proba
  
file_path: DESlib/deslib/des/base.py
imports: from abc import ABCMeta
  import numpy
  from deslib.base import BaseDS
  from deslib.util.aggregation import aggregate_proba_ensemble_weighted, sum_votes_per_class, get_weighted_votes
label_desc: Use image node_id 3 for calling the BaseDES obj's underlying member method code with example usage: obj.predict_proba_with_ds(predictions, probabilities, competence_region, distances, DFP_mask) and returns: predicted_proba