docstr: Evaluate using a the trained model after HPO(Hyper Parameter Optimization).
  
  Please note that evaluate result is calculated by scaled y and yhat. If you scaled
  your data (e.g. use .scale() on the TSDataset) please follow the following code
  snap to evaluate your result if you need to evaluate on unscaled data.
  
  >>> from zoo.automl.metrics import Evaluator
  >>> y_hat = automodel.predict(x)
  >>> y_hat_unscaled = tsdata.unscale_numpy(y_hat) # or other customized unscale methods
  >>> y_unscaled = tsdata.unscale_numpy(y) # or other customized unscale methods
  >>> Evaluator.evaluate(metric=..., y_unscaled, y_hat_unscaled, multioutput=...)
  
  :param data: a numpy ndarray tuple (x, y) x's shape is (num_samples, lookback,
         feature_dim) where lookback and feature_dim should be the same as
         past_seq_len and input_feature_num. y's shape is (num_samples, horizon,
         target_dim), where horizon and target_dim should be the same as
         future_seq_len and output_target_num.
  :param batch_size: evaluate batch size. The value will not affect evaluate
         result but will affect resources cost(e.g. memory and time).
  :param metrics: a list stated the metric names to be evaluated.
  :param multioutput: Defines aggregating of multiple output values.
         String in ['raw_values', 'uniform_average']. The value defaults to
         'raw_values'.
  
  :return: A list of evaluation results. Each item represents a metric.
docstr_tok: ["Evaluate","using","a","the","trained","model","after","HPO","(","Hyper","Parameter","Optimization",")",".","Please","note","that","evaluate","result","is","calculated","by","scaled","y","and","yhat",".","If","you","scaled","your","data","(","e.g",".","use",".scale","(",")","on","the","TSDataset",")","please","follow","the","following","code","snap","to","evaluate","your","result","if","you","need","to","evaluate","on","unscaled","data",".",">",">",">","from","zoo.automl.metrics","import","Evaluator",">",">",">","y_hat","=","automodel.predict","(","x",")",">",">",">","y_hat_unscaled","=","tsdata.unscale_numpy","(","y_hat",")","#","or","other","customized","unscale","methods",">",">",">","y_unscaled","=","tsdata.unscale_numpy","(","y",")","#","or","other","customized","unscale","methods",">",">",">","Evaluator.evaluate","(","metric=","...",",","y_unscaled",",","y_hat_unscaled",",","multioutput=","...",")",":","param","data",":","a","numpy","ndarray","tuple","(","x",",","y",")","x","'s","shape","is","(","num_samples",",","lookback",",","feature_dim",")","where","lookback","and","feature_dim","should","be","the","same","as","past_seq_len","and","input_feature_num",".","y","'s","shape","is","(","num_samples",",","horizon",",","target_dim",")",",","where","horizon","and","target_dim","should","be","the","same","as","future_seq_len","and","output_target_num",".",":","param","batch_size",":","evaluate","batch","size",".","The","value","will","not","affect","evaluate","result","but","will","affect","resources","cost","(","e.g",".","memory","and","time",")",".",":","param","metrics",":","a","list","stated","the","metric","names","to","be","evaluated",".",":","param","multioutput",":","Defines","aggregating","of","multiple","output","values",".","String","in","[","'raw_values","'",",","'uniform_average","'","]",".","The","value","defaults","to","'raw_values","'",".",":","return",":","A","list","of","evaluation","results",".","Each","item","represents","a","metric","."]
code: def evaluate(
      self,
      data,
      batch_size=32,
      metrics=["mse"],
      multioutput="raw_values",
  ):
      """
      Evaluate using a the trained model after HPO(Hyper Parameter Optimization).
  
      Please note that evaluate result is calculated by scaled y and yhat. If you scaled
      your data (e.g. use .scale() on the TSDataset) please follow the following code
      snap to evaluate your result if you need to evaluate on unscaled data.
  
      >>> from zoo.automl.metrics import Evaluator
      >>> y_hat = automodel.predict(x)
      >>> y_hat_unscaled = tsdata.unscale_numpy(y_hat) # or other customized unscale methods
      >>> y_unscaled = tsdata.unscale_numpy(y) # or other customized unscale methods
      >>> Evaluator.evaluate(metric=..., y_unscaled, y_hat_unscaled, multioutput=...)
  
      :param data: a numpy ndarray tuple (x, y) x's shape is (num_samples, lookback,
             feature_dim) where lookback and feature_dim should be the same as
             past_seq_len and input_feature_num. y's shape is (num_samples, horizon,
             target_dim), where horizon and target_dim should be the same as
             future_seq_len and output_target_num.
      :param batch_size: evaluate batch size. The value will not affect evaluate
             result but will affect resources cost(e.g. memory and time).
      :param metrics: a list stated the metric names to be evaluated.
      :param multioutput: Defines aggregating of multiple output values.
             String in ['raw_values', 'uniform_average']. The value defaults to
             'raw_values'.
  
      :return: A list of evaluation results. Each item represents a metric.
      """
      if self.best_model is None:
          raise RuntimeError(
              "You must call fit or load first before calling predict!"
          )
      return self.best_model.evaluate(
          data[0],
          data[1],
          metrics=metrics,
          multioutput=multioutput,
          batch_size=batch_size,
      )
  
file_path: analytics-zoo/pyzoo/zoo/chronos/autots/model/base_automodel.py
imports: import os
  import json
label_desc: Use image node_id 5 for calling the BasePytorchAutomodel obj's underlying member method code with example usage: obj.evaluate(data, batch_size, metrics, multioutput) and returns: self