code: def KL_max_disagreement(
      committee: BaseCommittee, X: modALinput, **predict_proba_kwargs
  ) -> np.ndarray:
      """
      Calculates the max disagreement for the Committee. First it computes the class probabilties of X for each learner in
      the Committee, then calculates the consensus probability distribution by averaging the individual class
      probabilities for each learner. Then each learner's class probabilities are compared to the consensus distribution
      in the sense of Kullback-Leibler divergence. The max disagreement for a given sample is the argmax of the KL
      divergences of the learners from the consensus probability.
  
      Args:
          committee: The :class:`modAL.models.BaseCommittee` instance for which the max disagreement is to be calculated.
          X: The data for which the max disagreement is to be calculated.
          **predict_proba_kwargs: Keyword arguments for the :meth:`predict_proba` of the Committee.
  
      Returns:
          Max disagreement of the Committee for the samples in X.
      """
      try:
          p_vote = committee.vote_proba(X, **predict_proba_kwargs)
      except NotFittedError:
          return np.zeros(shape=(X.shape[0],))
  
      p_consensus = np.mean(p_vote, axis=1)
  
      learner_KL_div = np.zeros(shape=(X.shape[0], len(committee)))
      for learner_idx, _ in enumerate(committee):
          learner_KL_div[:, learner_idx] = entropy(
              np.transpose(p_vote[:, learner_idx, :]),
              qk=np.transpose(p_consensus),
          )
  
      return np.max(learner_KL_div, axis=1)
  
file_path: modAL/modAL/disagreement.py
imports: from collections import Counter
  import numpy
  from scipy.stats import entropy
  from sklearn.base import BaseEstimator
  from sklearn.exceptions import NotFittedError
  from modAL.models.base import BaseCommittee
  from modAL.utils.data import modALinput
  from modAL.utils.selection import multi_argmax, shuffled_argmax
label_desc: Use image node_id 3 for calling a global function with example usage: KL_max_disagreement(committee, X) and returns: np, np