code: def testEvaluateExistingMetricsCustomEstimatorBasic(self):
      # Custom estimator aims to predict age * 3 + 1
      temp_eval_export_dir = self._getEvalExportDir()
      _, eval_export_dir = custom_estimator.simple_custom_estimator(
          None, temp_eval_export_dir
      )
  
      example1 = example_pb2.Example()
      example1.features.feature["age"].float_list.value[:] = [1.0]
      example1.features.feature["label"].float_list.value[:] = [3.0]
      eval_saved_model = load.EvalSavedModel(eval_export_dir)
  
      example2 = example_pb2.Example()
      example2.features.feature["age"].float_list.value[:] = [2.0]
      example2.features.feature["label"].float_list.value[:] = [7.0]
      eval_saved_model.metrics_reset_update_get_list(
          [example1.SerializeToString(), example2.SerializeToString()]
      )
  
      metric_values = eval_saved_model.get_metric_values()
  
      # We don't control the trained model's weights fully, but it should
      # predict close to what it aims to. The "target" mean prediction is 5.5.
      self.assertIn("mean_prediction", metric_values)
      self.assertGreater(metric_values["mean_prediction"], 5.4)
      self.assertLess(metric_values["mean_prediction"], 5.6)
  
      # The "target" mean absolute error is 0.5
      self.assertIn("mean_absolute_error", metric_values)
      self.assertGreater(metric_values["mean_absolute_error"], 0.4)
      self.assertLess(metric_values["mean_absolute_error"], 0.6)
  
      self.assertHasKeyWithValueAlmostEqual(
          metric_values, "mean_label", 5.0
      )
  
imports: import os
  import numpy
  import tensorflow
  from tensorflow_model_analysis.eval_saved_model import encoding
  from tensorflow_model_analysis.eval_saved_model import load
  from tensorflow_model_analysis.eval_saved_model import testutil
  from tensorflow_model_analysis.eval_saved_model.example_trainers import control_dependency_estimator
  from tensorflow_model_analysis.eval_saved_model.example_trainers import csv_linear_classifier
  from tensorflow_model_analysis.eval_saved_model.example_trainers import custom_estimator
  from tensorflow_model_analysis.eval_saved_model.example_trainers import dnn_classifier
  from tensorflow_model_analysis.eval_saved_model.example_trainers import fake_multi_examples_per_input_estimator
  from tensorflow_model_analysis.eval_saved_model.example_trainers import fake_sequence_to_prediction
  from tensorflow_model_analysis.eval_saved_model.example_trainers import fixed_prediction_classifier
  from tensorflow_model_analysis.eval_saved_model.example_trainers import fixed_prediction_estimator
  from tensorflow_model_analysis.eval_saved_model.example_trainers import fixed_prediction_estimator_no_labels
  from tensorflow_model_analysis.eval_saved_model.example_trainers import linear_classifier
  from tensorflow_model_analysis.eval_saved_model.example_trainers import linear_classifier_multivalent
  from tensorflow_model_analysis.eval_saved_model.example_trainers import multi_head
  from tensorflow_model_analysis.post_export_metrics import metrics
  from tensorflow.core.example import example_pb2
label_desc: Use image node_id 19 for calling the IntegrationTest obj's underlying member method code with example usage: obj.testEvaluateExistingMetricsCustomEstimatorBasic() without return types