class_docstr: Base class for models
class_docstr_tok: ["Base","class","for","models"]
docstr: Make final output as prediction score, according to different tasks.
  
  Args:
      logit (object): Base prediction value.
      task (str): A task (values: regression/classification)
  
  Returns:
      object: Transformed score.
docstr_tok: ["Make","final","output","as","prediction","score",",","according","to","different","tasks",".","Args",":","logit","(","object",")",":","Base","prediction","value",".","task","(","str",")",":","A","task","(","values",":","regression\/classification",")","Returns",":","object",":","Transformed","score","."]
code: def _get_pred(self, logit, task):
      """Make final output as prediction score, according to different tasks.
  
      Args:
          logit (object): Base prediction value.
          task (str): A task (values: regression/classification)
  
      Returns:
          object: Transformed score.
      """
      if task == "regression":
          pred = tf.identity(logit)
      elif task == "classification":
          pred = tf.sigmoid(logit)
      else:
          raise ValueError(
              "method must be regression or classification, but now is {0}".format(
                  task
              )
          )
      pred = tf.identity(pred, name="pred")
      return pred
  
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 4 for calling the BaseModel obj's underlying member method code with example usage: obj._get_pred(logit, task) and returns: pred