class_docstr: :class:`AbstractMetric` is the base object of all metrics. If you want to
      implement a metric, you should inherit this class.
  
  Args:
      config (Config): the config of evaluator.
class_docstr_tok: [":","class",":","`","AbstractMetric","`","is","the","base","object","of","all","metrics",".","If","you","want","to","implement","a","metric",",","you","should","inherit","this","class",".","Args",":","config","(","Config",")",":","the","config","of","evaluator","."]
docstr: Get the dictionary of a metric.
  
  Args:
      dataobject(DataStruct): it contains all the information needed to calculate metrics.
  
  Returns:
      dict: such as ``{'metric@10': 3153, 'metric@20': 0.3824}``
docstr_tok: ["Get","the","dictionary","of","a","metric",".","Args",":","dataobject","(","DataStruct",")",":","it","contains","all","the","information","needed","to","calculate","metrics",".","Returns",":","dict",":","such","as","``","{","'metric","@","10","'",":","3153",",","'metric","@","20","'",":","0.3824","}","``"]
code: def calculate_metric(self, dataobject):
      """Get the dictionary of a metric.
  
      Args:
          dataobject(DataStruct): it contains all the information needed to calculate metrics.
  
      Returns:
          dict: such as ``{'metric@10': 3153, 'metric@20': 0.3824}``
      """
      raise NotImplementedError(
          "Method [calculate_metric] should be implemented."
      )
  
file_path: RecBole/recbole/evaluator/base_metric.py
imports: import torch
  from recbole.utils import EvaluatorType
label_desc: Use image node_id 2 for calling the AbstractMetric obj's underlying member method code with example usage: obj.calculate_metric(dataobject) without return types