class_docstr: Uncertainty Sampling based on Category Vector Inconsistency and Ranking of Scores [RCV18]_
  selects instances based on the inconsistency of predicted labels and per-class label rankings.
class_docstr_tok: ["Uncertainty","Sampling","based","on","Category","Vector","Inconsistency","and","Ranking","of","Scores","[","RCV18","]","_","selects","instances","based","on","the","inconsistency","of","predicted","labels","and","per-class","label","rankings","."]
code: def _distance(
      self,
      y_pred_unlabeled_sub,
      y_arr,
      num_classes,
      a,
      b,
      c,
      d,
      hamming_distance,
  ):
      distance = hamming_distance
  
      y_arr_ones = y_arr.sum(axis=1)
      y_arr_zeros = y_arr.shape[1] - y_arr_ones
      entropy_labeled = self._entropy(
          y_arr_ones, num_classes
      ) + self._entropy(y_arr_zeros, num_classes)
      entropy_labeled = np.tile(
          entropy_labeled[np.newaxis, :],
          (y_pred_unlabeled_sub.shape[0], 1),
      )
  
      y_pred_unlabeled_sub_ones = y_pred_unlabeled_sub.sum(axis=1)
      y_pred_unlabeled_sub_zeros = (
          y_pred_unlabeled_sub.shape[1] - y_pred_unlabeled_sub_ones
      )
      entropy_unlabeled = self._entropy(
          y_pred_unlabeled_sub_ones, num_classes
      ) + self._entropy(y_pred_unlabeled_sub_zeros, num_classes)
      entropy_unlabeled = np.tile(
          entropy_unlabeled[:, np.newaxis], (1, y_arr.shape[0])
      )
  
      joint_entropy = self._entropy(b + c, num_classes) + self._entropy(
          a + d, num_classes
      )
      joint_entropy += (
          (b + c)
          / num_classes
          * (self._entropy(b, b + c) + self._entropy(c, b + c))
      )
      joint_entropy += (
          (a + d)
          / num_classes
          * (self._entropy(a, a + d) + self._entropy(d, a + d))
      )
  
      entropy_distance = (
          2 * joint_entropy - entropy_unlabeled - entropy_labeled
      )
      entropy_distance /= joint_entropy + self.epsilon
  
      distance[hamming_distance == 1] = 1
  
      return distance
  
file_path: small-text/small_text/query_strategies/multi_label.py
imports: import numpy
  from small_text.query_strategies.base import constraints
  from small_text.query_strategies.strategies import QueryStrategy
  from small_text.utils.context import build_pbar_context
label_desc: Use image node_id 5 for calling the CategoryVectorInconsistencyAndRanking obj's underlying member method code with example usage: obj._distance(y_pred_unlabeled_sub, y_arr, num_classes, a, b, c, d, hamming_distance) and returns: distance