code: def test_confusion_matrix_invalid_average_type(self):
      y_pred = [1, 0, 1, 0, 1, 0, 0]
      y_true = [1, 1, 0, 0, 1, 0, 1]
      confusion_matrix = _classification.ConfusionMatrixAggFn(
          average=AverageType.WEIGHTED
      )
      with self.assertRaisesRegex(
          NotImplementedError, " is not supported"
      ):
          confusion_matrix(y_true, y_pred)
  
imports: from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  from tensorflow_model_analysis.experimental.metrics.aggregates import _classification
label_desc: Use image node_id 14 for calling the ClassificationTest obj's underlying member method code with example usage: obj.test_confusion_matrix_invalid_average_type() without return types