code: def testValidateMetricsChangeThresholdHigherIsBetterFail(
      self, slicing_specs, slice_key
  ):
      threshold = config_pb2.MetricThreshold(
          change_threshold=config_pb2.GenericChangeThreshold(
              direction=config_pb2.MetricDirection.HIGHER_IS_BETTER,
              absolute={"value": 0},
          )
      )
      eval_config = config_pb2.EvalConfig(
          model_specs=[
              config_pb2.ModelSpec(),
              config_pb2.ModelSpec(name="baseline", is_baseline=True),
          ],
          slicing_specs=slicing_specs,
          metrics_specs=[
              config_pb2.MetricsSpec(
                  metrics=[
                      config_pb2.MetricConfig(
                          class_name="MeanPrediction",
                          # Diff = -.333 > 0, NOT OK.
                          threshold=threshold
                          if slicing_specs is None
                          else None,
                          per_slice_thresholds=[
                              config_pb2.PerSliceMetricThreshold(
                                  slicing_specs=slicing_specs,
                                  threshold=threshold,
                              )
                          ],
                      )
                  ],
                  model_names=[""],
              ),
          ],
      )
      sliced_metrics = (
          slice_key,
          {
              metric_types.MetricKey(
                  name="mean_prediction", model_name="baseline"
              ): 0.333,
              metric_types.MetricKey(
                  name="mean_prediction", is_diff=True
              ): -0.333,
          },
      )
      result = metrics_validator.validate_metrics(
          sliced_metrics, eval_config
      )
      self.assertFalse(result.validation_ok)
  
imports: from absl.testing import parameterized
  import tensorflow
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.eval_saved_model import testutil
  from tensorflow_model_analysis.evaluators import metrics_validator
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.proto import validation_result_pb2
  from tensorflow_model_analysis.slicer import slicer_lib
  from google.protobuf import text_format
label_desc: Use image node_id 16 for calling the MetricsValidatorTest obj's underlying member method code with example usage: obj.testValidateMetricsChangeThresholdHigherIsBetterFail(slicing_specs, slice_key) without return types