code: def entropy_func(n_classes, supports, is_correct):
      """Calculate the entropy in the support obtained by
      the base classifier. The value of the source competence is inverse
      proportional to the normalized entropy of its supports vector and the sign
      of competence is simply determined  by the correct/incorrect classification
  
      Parameters
      ----------
      n_classes : int
          The number of classes in the problem
  
      supports: array of shape (n_samples, n_classes)
          Containing the supports obtained by the base classifier for each class.
  
      is_correct: array of shape (n_samples)
          Array with 1 whether the base classifier predicted the correct label
          and -1 otherwise
  
      Returns
      -------
      C_src : array of shape (n_samples)
          Representing the classifier competences at each data point
  
      References
      ----------
      B. Antosik, M. Kurzynski, New measures of classifier competence –
      heuristics and application to the design of multiple classifier systems.,
      in: Computer recognition systems 4., 2011, pp. 197–206.
      """
      n_samples = is_correct.shape[0]
      if n_samples != supports.shape[0]:
          raise ValueError(
              "The number of samples in X and y must be the same"
              "n_samples X = {}, n_samples y = {} ".format(
                  n_samples, supports.shape[0]
              )
          )
  
      supports[supports > 1.0] = 1.0
      supports[supports < 0.0] = 0.0
  
      C_src = (1.0 / np.log(n_classes)) * (entropy(supports, axis=1))
      C_src += (2 * is_correct) - 1
      return C_src
  
file_path: DESlib/deslib/util/prob_functions.py
imports: import numpy
  from scipy.special import betainc
  from scipy.stats import entropy
label_desc: Use image node_id 3 for calling a global function with example usage: entropy_func(n_classes, supports, is_correct) and returns: C_src