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 _compute_vector_inconsistency(
      self, y, y_pred_unlabeled, num_classes
  ):
      y_arr = y.toarray()
  
      num_batches = int(
          np.ceil(len(y_pred_unlabeled) / self.batch_size)
      )
  
      vector_inconsistency = np.array([], dtype=np.float32)
      num_unlabeled = y_pred_unlabeled.shape[0]
  
      with build_pbar_context(
          self.pbar, tqdm_kwargs={"total": num_unlabeled}
      ) as pbar:
          for batch_idx in np.array_split(
              np.arange(num_unlabeled), num_batches, axis=0
          ):
              y_pred_unlabeled_sub = y_pred_unlabeled[batch_idx]
              # as an exception the variables a,b,c,d of the contingency table are adopted
              a = y_pred_unlabeled_sub.dot(y_arr.T)
              b = np.logical_not(y_pred_unlabeled_sub).dot(y_arr.T)
              c = y_pred_unlabeled_sub.dot(np.logical_not(y_arr).T)
              d = (
                  np.logical_not(y_pred_unlabeled_sub)
                  .dot(np.logical_not(y_arr).T)
                  .astype(int)
              )
  
              hamming_distance = (b + c) / num_classes
  
              distance = self._distance(
                  y_pred_unlabeled_sub,
                  y_arr,
                  num_classes,
                  a,
                  b,
                  c,
                  d,
                  hamming_distance,
              )
              distance = (
                  distance.sum(axis=1) / y_pred_unlabeled_sub.shape[0]
              )
              vector_inconsistency = np.append(
                  vector_inconsistency, distance
              )
  
              pbar.update(batch_idx.shape[0])
  
      return vector_inconsistency
  
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 4 for calling the CategoryVectorInconsistencyAndRanking obj's underlying member method code with example usage: obj._compute_vector_inconsistency(y, y_pred_unlabeled, num_classes) and returns: vector_inconsistency