class_docstr: Base class for models
class_docstr_tok: ["Base","class","for","models"]
docstr: Evaluate the given file and returns some evaluation metrics.
  
  Args:
      filename (str): A file name that will be evaluated.
  
  Returns:
      dict: A dictionary that contains evaluation metrics.
docstr_tok: ["Evaluate","the","given","file","and","returns","some","evaluation","metrics",".","Args",":","filename","(","str",")",":","A","file","name","that","will","be","evaluated",".","Returns",":","dict",":","A","dictionary","that","contains","evaluation","metrics","."]
code: def run_eval(self, filename):
      """Evaluate the given file and returns some evaluation metrics.
  
      Args:
          filename (str): A file name that will be evaluated.
  
      Returns:
          dict: A dictionary that contains evaluation metrics.
      """
      load_sess = self.sess
      preds = []
      labels = []
      imp_indexs = []
      for (
          batch_data_input,
          imp_index,
          data_size,
      ) in self.iterator.load_data_from_file(filename):
          step_pred, step_labels = self.eval(
              load_sess, batch_data_input
          )
          preds.extend(np.reshape(step_pred, -1))
          labels.extend(np.reshape(step_labels, -1))
          imp_indexs.extend(np.reshape(imp_index, -1))
      res = cal_metric(labels, preds, self.hparams.metrics)
      if "pairwise_metrics" in self.hparams.values():
          group_labels, group_preds = self.group_labels(
              labels, preds, imp_indexs
          )
          res_pairwise = cal_metric(
              group_labels, group_preds, self.hparams.pairwise_metrics
          )
          res.update(res_pairwise)
      return res
  
imports: from os.path import join
  import abc
  import time
  import os
  import numpy
  import tensorflow
  from recommenders.models.deeprec.deeprec_utils import cal_metric
label_desc: Use image node_id 23 for calling the BaseModel obj's underlying member method code with example usage: obj.run_eval(filename) and returns: res