docstr: Evaluate model.
  
  :param data: data: evaluation data. It can be an XShards, Spark Dataframe,
         PyTorch DataLoader and PyTorch DataLoader creator function.
         If data is an XShards, each partition can be a Pandas DataFrame or 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 evaluation. Only used when data is a SparkXShard.
  :param feature_cols: Feature column name(s) of data. Only used when data
         is a Spark DataFrame or an XShards of Pandas DataFrame. Default: None.
  :param label_cols: Label column name(s) of data. Only used when data is
         a Spark DataFrame or an XShards of Pandas DataFrame. Default: None.
  :param validation_metrics: Orca validation metrics to be computed on validation_data.
  :return: validation results.
docstr_tok: ["Evaluate","model",".",":","param","data",":","data",":","evaluation","data",".","It","can","be","an","XShards",",","Spark","Dataframe",",","PyTorch","DataLoader","and","PyTorch","DataLoader","creator","function",".","If","data","is","an","XShards",",","each","partition","can","be","a","Pandas","DataFrame","or","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","evaluation",".","Only","used","when","data","is","a","SparkXShard",".",":","param","feature_cols",":","Feature","column","name","(","s",")","of","data",".","Only","used","when","data","is","a","Spark","DataFrame","or","an","XShards","of","Pandas","DataFrame",".","Default",":","None",".",":","param","label_cols",":","Label","column","name","(","s",")","of","data",".","Only","used","when","data","is","a","Spark","DataFrame","or","an","XShards","of","Pandas","DataFrame",".","Default",":","None",".",":","param","validation_metrics",":","Orca","validation","metrics","to","be","computed","on","validation_data",".",":","return",":","validation","results","."]
code: def evaluate(
      self,
      data,
      batch_size=None,
      feature_cols=None,
      label_cols=None,
      validation_metrics=None,
  ):
      """
      Evaluate model.
  
      :param data: data: evaluation data. It can be an XShards, Spark Dataframe,
             PyTorch DataLoader and PyTorch DataLoader creator function.
             If data is an XShards, each partition can be a Pandas DataFrame or 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 evaluation. Only used when data is a SparkXShard.
      :param feature_cols: Feature column name(s) of data. Only used when data
             is a Spark DataFrame or an XShards of Pandas DataFrame. Default: None.
      :param label_cols: Label column name(s) of data. Only used when data is
             a Spark DataFrame or an XShards of Pandas DataFrame. Default: None.
      :param validation_metrics: Orca validation metrics to be computed on validation_data.
      :return: validation results.
      """
      from zoo.orca.data.utils import xshard_to_sample
  
      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, DataLoader):
          assert batch_size is None and data.batch_size > 0, (
              "When using PyTorch Dataloader as "
              "input, you need to specify the "
              "batch size in DataLoader and "
              "don't specify batch_size "
              "in the fit method."
          )
      else:
          assert (
              batch_size is not None and batch_size > 0
          ), "batch_size should be greater than 0"
  
      if isinstance(data, SparkXShards):
          if data._get_class_name() == "pandas.core.frame.DataFrame":
              data = process_xshards_of_pandas_dataframe(
                  data, feature_cols, label_cols
              )
          val_feature_set = FeatureSet.sample_rdd(
              data.rdd.flatMap(xshard_to_sample)
          )
          result = self.estimator.evaluate(
              val_feature_set, self.metrics, batch_size
          )
      elif isinstance(data, DataFrame):
          schema = data.schema
          val_feature_set = FeatureSet.sample_rdd(
              data.rdd.map(
                  lambda row: row_to_sample(
                      row, schema, feature_cols, label_cols
                  )
              )
          )
          result = self.estimator.evaluate(
              val_feature_set, self.metrics, batch_size
          )
      elif (
          isinstance(data, DataLoader)
          or callable(data)
          or isinstance(data, types.FunctionType)
      ):
          if isinstance(data, types.FunctionType):
              data = data(self.config, batch_size)
          val_feature_set = FeatureSet.pytorch_dataloader(data)
          result = self.estimator.evaluate_minibatch(
              val_feature_set, self.metrics
          )
      else:
          raise ValueError(
              "Data should be a SparkXShards, a DataLoader or a callable "
              "data_creator, but get " + data.__class__.__name__
          )
      return bigdl_metric_results_to_dict(result)
  
imports: from zoo.common.utils import enable_multi_fs_load, enable_multi_fs_save
  from zoo.orca.data.utils import row_to_sample, xshard_to_sample
  from zoo.orca.learn.utils import convert_predict_rdd_to_dataframe, bigdl_metric_results_to_dict, process_xshards_of_pandas_dataframe
  from zoo.pipeline.estimator.estimator import Estimator
  from zoo.orca.learn.ray_estimator import Estimator
  from zoo.orca.learn.pytorch.training_operator import TrainingOperator
  from zoo.orca.learn.spark_estimator import Estimator
  from zoo.orca.learn.optimizers import Optimizer, SGD
  from zoo.orca.learn.metrics import Accuracy
  from zoo.orca.data import SparkXShards
  from bigdl.optim.optimizer import MaxEpoch, OptimMethod
  from zoo.feature.common import FeatureSet
  from torch.optim.optimizer import Optimizer
  from torch.utils.data import DataLoader
  from pyspark.sql import DataFrame
  import warnings
  import torch
  import types
label_desc: Use image node_id 7 for calling the PyTorchSparkEstimator obj's underlying member method code with example usage: obj.evaluate(data, batch_size, feature_cols, label_cols, validation_metrics) and returns: bigdl_metric_results_to_dict