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 _rank_by_margin(self, proba):
      num_classes = proba.shape[1]
  
      proba_sum = proba.sum(axis=1)
      margin = proba - np.tile(
          proba_sum[:, np.newaxis], (1, num_classes)
      )
      margin = np.absolute(margin)
  
      ranks = np.array(
          [np.argsort(margin[:, j]) for j in range(num_classes)]
      )
      return ranks
  
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 8 for calling the CategoryVectorInconsistencyAndRanking obj's underlying member method code with example usage: obj._rank_by_margin(proba) and returns: ranks