docstr: Evaluate model.
  
  :param data: validation data. It can be XShardsor or Spark DataFrame, each partition is
         a dictionary of {'x': feature, 'y': label}, where feature(label) is a numpy array
         or a list of numpy arrays.
  :param batch_size: Batch size used for validation. Default: 32.
  :param feature_cols: (Not supported yet) Feature column name(s) of data. Only used when
         data is a Spark  DataFrame. Default: None.
  :param label_cols: (Not supported yet) Label column name(s) of data. Only used when data
         is a Spark DataFrame. Default: None.
  :return:
docstr_tok: ["Evaluate","model",".",":","param","data",":","validation","data",".","It","can","be","XShardsor","or","Spark","DataFrame",",","each","partition","is","a","dictionary","of","{","'","x","'",":","feature",",","'","y","'",":","label","}",",","where","feature","(","label",")","is","a","numpy","array","or","a","list","of","numpy","arrays",".",":","param","batch_size",":","Batch","size","used","for","validation",".","Default",":","32.",":","param","feature_cols",":","(","Not","supported","yet",")","Feature","column","name","(","s",")","of","data",".","Only","used","when","data","is","a","Spark","DataFrame",".","Default",":","None",".",":","param","label_cols",":","(","Not","supported","yet",")","Label","column","name","(","s",")","of","data",".","Only","used","when","data","is","a","Spark","DataFrame",".","Default",":","None",".",":","return",":"]
code: def evaluate(
      self,
      data,
      batch_size=32,
      feature_cols="features",
      label_cols="label",
  ):
      """
      Evaluate model.
  
      :param data: validation data. It can be XShardsor or Spark DataFrame, each partition is
             a dictionary of {'x': feature, 'y': label}, where feature(label) is a numpy array
             or a list of numpy arrays.
      :param batch_size: Batch size used for validation. Default: 32.
      :param feature_cols: (Not supported yet) Feature column name(s) of data. Only used when
             data is a Spark  DataFrame. Default: None.
      :param label_cols: (Not supported yet) Label column name(s) of data. Only used when data
             is a Spark DataFrame. Default: None.
      :return:
      """
      assert data is not None, "validation data shouldn't be None"
      assert self.metrics is not None, (
          "metrics shouldn't be None, please specify the metrics"
          " argument when creating this estimator."
      )
  
      if isinstance(data, DataFrame):
          if isinstance(feature_cols, list):
              data, _, feature_cols = BigDLEstimator._combine_cols(
                  data, [feature_cols], col_name="features"
              )
  
          if isinstance(label_cols, list):
              data, _, label_cols = BigDLEstimator._combine_cols(
                  data, label_cols, col_name="label"
              )
  
          self.nn_estimator._setNNBatchSize(
              batch_size
          )._setNNFeaturesCol(feature_cols)._setNNLabelCol(label_cols)
  
          self.nn_estimator.setValidation(
              None, None, self.metrics, batch_size
          )
          if self.log_dir is not None and self.app_name is not None:
              from bigdl.optim.optimizer import TrainSummary
              from bigdl.optim.optimizer import ValidationSummary
  
              val_summary = ValidationSummary(
                  log_dir=self.log_dir, app_name=self.app_name
              )
              self.nn_estimator.setValidationSummary(val_summary)
  
          result = self.nn_estimator._eval(data)
  
      elif isinstance(data, SparkXShards):
          from zoo.orca.data.utils import xshard_to_sample
  
          val_feature_set = FeatureSet.sample_rdd(
              data.rdd.flatMap(xshard_to_sample)
          )
          result = self.estimator.evaluate(
              val_feature_set, self.metrics, batch_size
          )
      else:
          raise ValueError(
              "Data should be XShards or Spark DataFrame, but get "
              + data.__class__.__name__
          )
  
      return bigdl_metric_results_to_dict(result)
  
imports: from zoo.orca.learn.metrics import Metric
  from zoo.orca.learn.utils import bigdl_metric_results_to_dict
  from zoo.pipeline.nnframes import NNEstimator, NNModel
  from zoo.pipeline.estimator import Estimator
  from zoo.orca.learn.spark_estimator import Estimator
  from zoo.orca.data import SparkXShards
  from bigdl.optim.optimizer import MaxEpoch
  from zoo.feature.common import FeatureSet
  from zoo.orca.learn.metrics import Accuracy
  from pyspark.sql.dataframe import DataFrame
label_desc: Use image node_id 4 for calling the BigDLEstimator obj's underlying member method code with example usage: obj.evaluate(data, batch_size, feature_cols, label_cols) and returns: bigdl_metric_results_to_dict