class_docstr: Base class for models
class_docstr_tok: ["Base","class","for","models"]
docstr: Make predictions on the given data, and output predicted scores to a file.
  
  Args:
      infile_name (str): Input file name, format is same as train/val/test file.
      outfile_name (str): Output file name, each line is the predict score.
  
  Returns:
      object: An instance of self.
docstr_tok: ["Make","predictions","on","the","given","data",",","and","output","predicted","scores","to","a","file",".","Args",":","infile_name","(","str",")",":","Input","file","name",",","format","is","same","as","train\/val\/test","file",".","outfile_name","(","str",")",":","Output","file","name",",","each","line","is","the","predict","score",".","Returns",":","object",":","An","instance","of","self","."]
code: def predict(self, infile_name, outfile_name):
      """Make predictions on the given data, and output predicted scores to a file.
  
      Args:
          infile_name (str): Input file name, format is same as train/val/test file.
          outfile_name (str): Output file name, each line is the predict score.
  
      Returns:
          object: An instance of self.
      """
      load_sess = self.sess
      with tf.io.gfile.GFile(outfile_name, "w") as wt:
          for (
              batch_data_input,
              _,
              data_size,
          ) in self.iterator.load_data_from_file(infile_name):
              step_pred = self.infer(load_sess, batch_data_input)
              step_pred = step_pred[0][:data_size]
              step_pred = np.reshape(step_pred, -1)
              wt.write("\n".join(map(str, step_pred)))
              # line break after each batch.
              wt.write("\n")
      return self
  
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 24 for calling the BaseModel obj's underlying member method code with example usage: obj.predict(infile_name, outfile_name) and returns: self