class_docstr: Hit Ratio.
  
  Parameters
  ----------
  k: int, optional, default: -1 (all)
      The number of items in the top@k list.
      If None, all items will be considered.
class_docstr_tok: ["Hit","Ratio",".","Parameters","--","--","--","--","--","k",":","int",",","optional",",","default",":","-1","(","all",")","The","number","of","items","in","the","top","@","k","list",".","If","None",",","all","items","will","be","considered","."]
docstr: Compute Hit Ratio.
  
  Parameters
  ----------
  gt_pos: Numpy array
      Vector of positive items.
  
  pd_rank: Numpy array
      Item ranking prediction.
  
  **kwargs: For compatibility
  
  Returns
  -------
  res: A scalar
      Hit Ratio score (1.0 ground truth item(s) appear in top-k, 0 otherwise).
docstr_tok: ["Compute","Hit","Ratio",".","Parameters","--","--","--","--","--","gt_pos",":","Numpy","array","Vector","of","positive","items",".","pd_rank",":","Numpy","array","Item","ranking","prediction",".","*","*","kwargs",":","For","compatibility","Returns","--","--","--","-","res",":","A","scalar","Hit","Ratio","score","(","1.0","ground","truth","item","(","s",")","appear","in","top-k",",","0","otherwise",")","."]
code: def compute(self, gt_pos, pd_rank, **kwargs):
      """Compute Hit Ratio.
  
      Parameters
      ----------
      gt_pos: Numpy array
          Vector of positive items.
  
      pd_rank: Numpy array
          Item ranking prediction.
  
      **kwargs: For compatibility
  
      Returns
      -------
      res: A scalar
          Hit Ratio score (1.0 ground truth item(s) appear in top-k, 0 otherwise).
  
      """
      tp, *_ = MeasureAtK.compute(self, gt_pos, pd_rank, **kwargs)
  
      return 1.0 if tp > 0 else 0.0
  
imports: import numpy
  from scipy.stats import rankdata
label_desc: Use image node_id 2 for calling the HitRatio obj's underlying member method code with example usage: obj.compute(gt_pos, pd_rank) and returns: unknown