class_docstr: Base class for a DS method based on the potential function model.
  All DS methods based on the Potential function should inherit from this
  class.
  
  Warning: This class should not be used directly.
  Use derived classes instead.
docstr: estimate the competence of each base classifier :math:`c_{i}`
  using the source of competence :math:`C_{src}` and the potential
  function model. The source of competence :math:`C_{src}` for all
  data points in DSEL is already pre-computed in the fit() steps.
  
  .. math:: \delta_{i,j} = \frac{\sum_{k=1}^{N}C_{src} \:
    exp(-d (\mathbf{x}_{k}, \mathbf{x}_{q})^{2})}
    {exp( -d (\mathbf{x}_{k}, \mathbf{x}_{q})^{2} )}
  
  Parameters
  ----------
  competence_region : array of shape (n_samples, n_neighbors)
      Indices of the k nearest neighbors according for each test sample.
  
  distances : array of shape (n_samples, n_neighbors)
      Distances from the k nearest neighbors to the query.
  
  predictions : array of shape (n_samples, n_classifiers)
      Predictions of the base classifiers for all test examples.
  
  Returns
  -------
  competences : array of shape (n_samples, n_classifiers)
      Competence level estimated for each base classifier and test
      example.
code: def estimate_competence(
      self, competence_region, distances, predictions=None
  ):
      """estimate the competence of each base classifier :math:`c_{i}`
      using the source of competence :math:`C_{src}` and the potential
      function model. The source of competence :math:`C_{src}` for all
      data points in DSEL is already pre-computed in the fit() steps.
  
      .. math:: \\delta_{i,j} = \\frac{\\sum_{k=1}^{N}C_{src} \\:
        exp(-d (\\mathbf{x}_{k}, \\mathbf{x}_{q})^{2})}
        {exp( -d (\\mathbf{x}_{k}, \\mathbf{x}_{q})^{2} )}
  
      Parameters
      ----------
      competence_region : array of shape (n_samples, n_neighbors)
          Indices of the k nearest neighbors according for each test sample.
  
      distances : array of shape (n_samples, n_neighbors)
          Distances from the k nearest neighbors to the query.
  
      predictions : array of shape (n_samples, n_classifiers)
          Predictions of the base classifiers for all test examples.
  
      Returns
      -------
      competences : array of shape (n_samples, n_classifiers)
          Competence level estimated for each base classifier and test
          example.
      """
      potential_dists = self.potential_func(distances)
      potential_dists[potential_dists == 0] = 1e-20
      sum_potential = np.sum(potential_dists, axis=1)
  
      competences = np.einsum(
          "ijk,ij->ik",
          self.C_src_[competence_region, :],
          potential_dists,
      )
      competences = competences / sum_potential.reshape(-1, 1)
  
      return competences
  
file_path: DESlib/deslib/des/probabilistic/base.py
imports: from abc import abstractmethod, ABCMeta
  import numpy
  from deslib.des.base import BaseDES
label_desc: Use image node_id 4 for calling the BaseProbabilistic obj's underlying member method code with example usage: obj.estimate_competence(competence_region, distances, predictions) and returns: competences