code: def test_multioutput_metrics(self):
      y_true = np.array([[1, 0, 0, 1], [0, 1, 1, 1], [1, 1, 0, 1]])
      y_pred = np.array([[0, 0, 0, 1], [1, 0, 1, 1], [0, 0, 0, 1]])
      assert_almost_equal(
          MSE(y_true, y_pred, multioutput="uniform_average"),
          [(1.0 / 3 + 2.0 / 3 + 2.0 / 3) / 4.0],
      )
  
      assert_almost_equal(
          MSLE(y_true, y_pred, multioutput="uniform_average"),
          [0.200],
          decimal=2,
      )
  
      assert_almost_equal(
          MAE(y_true, y_pred, multioutput="uniform_average"),
          [(1.0 + 2.0 / 3) / 4.0],
      )
  
      assert_almost_equal(
          R2(y_true, y_pred, multioutput="variance_weighted"),
          [1.0 - 5.0 / 2],
      )
  
      assert_almost_equal(
          R2(y_true, y_pred, multioutput="uniform_average"), [-0.875]
      )
  
      y_true = [[3, -0.5, 2, 7], [3, -0.5, 2, 7], [3, -0.5, 2, 7]]
      y_pred = [[2.5, -0.3, 2, 8], [2.5, -0.3, 2, 8], [2.5, -0.3, 2, 8]]
  
      assert_almost_equal(
          sMAPE(y_true, y_pred, multioutput="uniform_average"),
          [10.19],
          decimal=2,
      )
      assert_almost_equal(
          MAPE(y_true, y_pred, multioutput="uniform_average"),
          [17.74],
          decimal=2,
      )
      assert_almost_equal(
          MPE(y_true, y_pred, multioutput="uniform_average"),
          [10.6],
          decimal=2,
      )
      assert_almost_equal(
          RMSE(y_true, y_pred, multioutput="uniform_average"),
          [0.57],
          decimal=2,
      )
  
      assert_almost_equal(
          ME(y_true, y_pred, multioutput="uniform_average"),
          [-0.18],
          decimal=2,
      )
      assert_almost_equal(
          MSPE(y_true, y_pred, multioutput="uniform_average"),
          [5.2],
          decimal=2,
      )
      assert_almost_equal(
          MDAPE(y_true, y_pred, multioutput="uniform_average"),
          [17.74],
          decimal=2,
      )
      assert_almost_equal(
          sMDAPE(y_true, y_pred, multioutput="uniform_average"),
          [10.19],
          decimal=2,
      )
  
file_path: analytics-zoo/pyzoo/test/zoo/orca/automl/test_metrics.py
imports: import numpy
  from test.zoo.pipeline.utils.test_utils import ZooTestCase
  from zoo.orca.automl.metrics import ME, MAE, MSE, RMSE, MSLE, R2
  from zoo.orca.automl.metrics import MPE, MAPE, MSPE, sMAPE, MDAPE, sMDAPE
  from numpy.testing import assert_almost_equal
  from numpy.testing import assert_array_almost_equal
label_desc: Use image node_id 4 for calling the TestMetrics obj's underlying member method code with example usage: obj.test_multioutput_metrics() without return types