code: def test_metrics(self, n_samples=50):
      y_true = np.arange(n_samples) + 1
      y_pred = y_true + 1
  
      assert_almost_equal(MSE(y_true, y_pred), [1.0])
      assert_almost_equal(
          MSLE(y_true, y_pred),
          MSE(np.log(1 + y_true), np.log(1 + y_pred)),
      )
      assert_almost_equal(MAE(y_true, y_pred), [1.0])
      assert_almost_equal(R2(y_true, y_pred), [0.995], 2)
  
      assert_almost_equal(sMAPE(y_true, y_pred), [3.89], decimal=2)
  
      y_true = [3, -0.5, 2, 7]
      y_pred = [2.5, -0.3, 2, 8]
  
      assert_almost_equal(MAPE(y_true, y_pred), [17.74], decimal=2)
      assert_almost_equal(MPE(y_true, y_pred), [10.6], decimal=2)
      assert_almost_equal(RMSE(y_true, y_pred), [0.57], decimal=2)
      assert_almost_equal(ME(y_true, y_pred), [-0.17], decimal=2)
      assert_almost_equal(MSPE(y_true, y_pred), [5.2], decimal=2)
      assert_almost_equal(MDAPE(y_true, y_pred), [15.48], decimal=2)
      assert_almost_equal(sMDAPE(y_true, y_pred), [7.88], 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 3 for calling the TestMetrics obj's underlying member method code with example usage: obj.test_metrics(n_samples) without return types