class_docstr: Base class for sequential models
class_docstr_tok: ["Base","class","for","sequential","models"]
docstr: Evaluate the given file and returns some evaluation metrics.
  
  Args:
      filename (str): A file name that will be evaluated.
      num_ngs (int): The number of negative sampling for a positive instance.
  
  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",".","num_ngs","(","int",")",":","The","number","of","negative","sampling","for","a","positive","instance",".","Returns",":","dict",":","A","dictionary","that","contains","evaluation","metrics","."]
code: def run_eval(self, filename, num_ngs):
      """Evaluate the given file and returns some evaluation metrics.
  
      Args:
          filename (str): A file name that will be evaluated.
          num_ngs (int): The number of negative sampling for a positive instance.
  
      Returns:
          dict: A dictionary that contains evaluation metrics.
      """
  
      load_sess = self.sess
      preds = []
      labels = []
      group_preds = []
      group_labels = []
      group = num_ngs + 1
  
      for batch_data_input in self.iterator.load_data_from_file(
          filename, min_seq_length=self.min_seq_length, batch_num_ngs=0
      ):
          if batch_data_input:
              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))
              group_preds.extend(np.reshape(step_pred, (-1, group)))
              group_labels.extend(np.reshape(step_labels, (-1, group)))
  
      res = cal_metric(labels, preds, self.hparams.metrics)
      res_pairwise = cal_metric(
          group_labels, group_preds, self.hparams.pairwise_metrics
      )
      res.update(res_pairwise)
      return res
  
file_path: recommenders/recommenders/models/deeprec/models/sequential/sequential_base_model.py
imports: import os
  import abc
  import numpy
  import tensorflow
  from recommenders.models.deeprec.models.base_model import BaseModel
  from recommenders.models.deeprec.deeprec_utils import cal_metric, load_dict
label_desc: Use image node_id 5 for calling the SequentialBaseModel obj's underlying member method code with example usage: obj.run_eval(filename, num_ngs) and returns: res