docstr: Evaluate a model by the given metrics.
  :param x: ndarray or list of ndarray for local mode.
            RDD[Sample] for distributed mode
  :param y: ndarray or list of ndarray for local mode and would be None for cluster mode.
  :param batch_size
  :param is_distributed: run in local mode or distributed mode.
         NB: if is_distributed=true, x should be RDD[Sample] and y should be None
  :return:
docstr_tok: ["Evaluate","a","model","by","the","given","metrics",".",":","param","x",":","ndarray","or","list","of","ndarray","for","local","mode",".","RDD","[","Sample","]","for","distributed","mode",":","param","y",":","ndarray","or","list","of","ndarray","for","local","mode","and","would","be","None","for","cluster","mode",".",":","param","batch_size",":","param","is_distributed",":","run","in","local","mode","or","distributed","mode",".","NB",":","if","is_distributed=true",",","x","should","be","RDD","[","Sample","]","and","y","should","be","None",":","return",":"]
code: def evaluate(
      self,
      x,
      y,
      batch_size=32,
      sample_weight=None,
      is_distributed=False,
  ):
      """
      Evaluate a model by the given metrics.
      :param x: ndarray or list of ndarray for local mode.
                RDD[Sample] for distributed mode
      :param y: ndarray or list of ndarray for local mode and would be None for cluster mode.
      :param batch_size
      :param is_distributed: run in local mode or distributed mode.
             NB: if is_distributed=true, x should be RDD[Sample] and y should be None
      :return:
      """
      if sample_weight:
          unsupport_exp("sample_weight")
      if is_distributed:
          if isinstance(x, np.ndarray):
              input = to_sample_rdd(x, y)
          elif isinstance(x, RDD):
              input = x
          if self.metrics:
              sc = get_spark_context()
              return [
                  r.result
                  for r in self.bmodel.evaluate(
                      input, batch_size, self.metrics
                  )
              ]
          else:
              invalidInputError(False, "No Metrics found.")
      else:
          invalidInputError(
              False, "We only support evaluation in distributed mode"
          )
  
file_path: BigDL/python/dllib/src/bigdl/dllib/nn/keras/backend.py
imports: from bigdl.dllib.nn.keras.optimization import *
  from bigdl.dllib.utils.common import *
label_desc: Use image node_id 2 for calling the KerasModelWrapper obj's underlying member method code with example usage: obj.evaluate(x, y, batch_size, sample_weight, is_distributed) and returns: unknown