class_docstr: Ranking Metric.
  
  Attributes
  ----------
  type: string, value: 'ranking'
      Type of the metric, e.g., "ranking", "rating".
  
  name: string, default: None
      Name of the measure.
  
  k: int or list, optional, default: -1 (all)
      The number of items in the top@k list.
      If None, all items will be considered.
class_docstr_tok: ["Ranking","Metric",".","Attributes","--","--","--","--","--","type",":","string",",","value",":","'ranking'","Type","of","the","metric",",","e.g.",",","``","ranking","''",",","``","rating","''",".","name",":","string",",","default",":","None","Name","of","the","measure",".","k",":","int","or","list",",","optional",",","default",":","-1","(","all",")","The","number","of","items","in","the","top","@","k","list",".","If","None",",","all","items","will","be","considered","."]
code: def __init__(self, name=None, k=-1, higher_better=True):
      assert hasattr(k, "__len__") or k == -1 or k > 0
  
      self.type = "ranking"
      self.name = name
      self.k = k
      self.higher_better = higher_better
  
imports: import numpy
  from scipy.stats import rankdata
label_desc: Use image node_id 1 to create a new RankingMetric object  with example: obj = RankingMetric(name, k, higher_better)