class_docstr: Evaluate metrics for y_true and y_pred.
class_docstr_tok: ["Evaluate","metrics","for","y_true","and","y_pred","."]
docstr: Evaluate a specific metrics for y_true and y_pred.
  :param metrics: String or list in ['mae', 'mse', 'rmse', 'r2', 'mape', 'smape'] for built-in
         metrics. If callable function, it signature should be func(y_true, y_pred), where
         y_true and y_pred are numpy ndarray.
  :param y_true: Array-like of shape = (n_samples, \*). Ground truth (correct) target values.
  :param y_pred: Array-like of shape = (n_samples, \*). Estimated target values.
  :param aggregate: aggregation method. Currently, "mean" and None are supported,
         'mean' represents aggregating by mean, while None will return the element-wise
         result. The value defaults to 'mean'.
  :return: Float or ndarray of floats.
           A floating point value, or an
           array of floating point values, one for each individual target.
docstr_tok: ["Evaluate","a","specific","metrics","for","y_true","and","y_pred",".",":","param","metrics",":","String","or","list","in","[","'mae","'",",","'mse","'",",","'rmse","'",",","'r2","'",",","'mape","'",",","'smape","'","]","for","built-in","metrics",".","If","callable","function",",","it","signature","should","be","func","(","y_true",",","y_pred",")",",","where","y_true","and","y_pred","are","numpy","ndarray",".",":","param","y_true",":","Array-like","of","shape","=","(","n_samples",",","\\","*",")",".","Ground","truth","(","correct",")","target","values",".",":","param","y_pred",":","Array-like","of","shape","=","(","n_samples",",","\\","*",")",".","Estimated","target","values",".",":","param","aggregate",":","aggregation","method",".","Currently",",","``","mean","''","and","None","are","supported",",","'mean","'","represents","aggregating","by","mean",",","while","None","will","return","the","element-wise","result",".","The","value","defaults","to","'mean","'",".",":","return",":","Float","or","ndarray","of","floats",".","A","floating","point","value",",","or","an","array","of","floating","point","values",",","one","for","each","individual","target","."]
code: def evaluate(metrics, y_true, y_pred, aggregate="mean"):
      """
      Evaluate a specific metrics for y_true and y_pred.
      :param metrics: String or list in ['mae', 'mse', 'rmse', 'r2', 'mape', 'smape'] for built-in
             metrics. If callable function, it signature should be func(y_true, y_pred), where
             y_true and y_pred are numpy ndarray.
      :param y_true: Array-like of shape = (n_samples, \*). Ground truth (correct) target values.
      :param y_pred: Array-like of shape = (n_samples, \*). Estimated target values.
      :param aggregate: aggregation method. Currently, "mean" and None are supported,
             'mean' represents aggregating by mean, while None will return the element-wise
             result. The value defaults to 'mean'.
      :return: Float or ndarray of floats.
               A floating point value, or an
               array of floating point values, one for each individual target.
      """
      metrics, y_true, y_pred, original_shape = _standard_input(
          metrics, y_true, y_pred
      )
  
      res_list = []
      for metric in metrics:
          if callable(metric):
              metric_func = metric
          else:
              metric_func = REGRESSION_MAP[metric]
          if len(original_shape) in [2, 3] and aggregate is None:
              res = np.zeros(y_true.shape[-1])
              for i in range(y_true.shape[-1]):
                  res[i] = metric_func(y_true[..., i], y_pred[..., i])
              res = res.reshape(original_shape[1:])
              res_list.append(res)
          else:
              res = metric_func(y_true, y_pred)
              res_list.append(res)
      return res_list
  
file_path: BigDL/python/chronos/src/bigdl/chronos/metric/forecast_metrics.py
imports: from numpy import ndarray
  import numpy
  from bigdl.nano.utils.common import invalidInputError
  from timeit import repeat
  import random
label_desc: Use image node_id 1 for calling the Evaluator obj's underlying member method code with example usage: obj.evaluate(metrics, y_true, y_pred, aggregate) and returns: res_list