code: def test_r2_metric(self):
      params = {"name": "r2"}
      m = Metric(params)
      y_true = np.array([0, 0, 1, 1])
      y_predicted = np.array([0, 0, 1, 1])
      score = m(y_true, y_predicted)
      self.assertEqual(score, -1.0)
  
file_path: mljar-supervised/tests/tests_utils/test_metric.py
imports: import unittest
  import numpy
  import pandas
  from numpy.testing import assert_almost_equal
  from supervised.utils.metric import Metric
  from supervised.utils.metric import UserDefinedEvalMetric
label_desc: Use image node_id 4 for calling the MetricTest obj's underlying member method code with example usage: obj.test_r2_metric() without return types