code: def test_errors(self):
      # Bad class_aggregation value
      with self.assertRaisesRegex(
          ValueError, "Invalid value for argument `class_aggregation`"
      ):
          metrics.R2Score(class_aggregation="wrong")
  
      # Bad num_regressors value
      with self.assertRaisesRegex(
          ValueError, "Invalid value for argument `num_regressors`"
      ):
          metrics.R2Score(num_regressors=-1)
  
      # Bad input shape
      with self.assertRaisesRegex(
          ValueError, "expects 2D inputs with shape"
      ):
          r2 = metrics.R2Score()
          r2.update_state([0.0, 1.0], [0.0, 1.0])
  
imports: import numpy
  from absl.testing import parameterized
  from keras import testing
  from keras.metrics import regression_metrics
label_desc: Use image node_id 5 for calling the R2ScoreTest obj's underlying member method code with example usage: obj.test_errors() without return types