docstr: Returns instance of tf.keras.metric with default args given name.
docstr_tok: ["Returns","instance","of","tf.keras.metric","with","default","args","given","name","."]
code: def _tf_metric_by_name(self, metric_name):
      """Returns instance of tf.keras.metric with default args given name."""
      if metric_name == "auc":
          return tf.keras.metrics.AUC(name="auc")
      elif metric_name == "auc_pr":
          return tf.keras.metrics.AUC(name="auc_pr", curve="PR")
      elif metric_name == "precision":
          return tf.keras.metrics.Precision(name="precision")
      elif metric_name == "precision@2":
          return tf.keras.metrics.Precision(name="precision@2", top_k=2)
      elif metric_name == "precision@3":
          return tf.keras.metrics.Precision(name="precision@3", top_k=3)
      elif metric_name == "recall":
          return tf.keras.metrics.Recall(name="recall")
      elif metric_name == "recall@2":
          return tf.keras.metrics.Recall(name="recall@2", top_k=2)
      elif metric_name == "recall@3":
          return tf.keras.metrics.Recall(name="recall@3", top_k=3)
      elif metric_name == "true_positives":
          return tf.keras.metrics.TruePositives(name="true_positives")
      elif metric_name == "false_positives":
          return tf.keras.metrics.FalsePositives(name="false_positives")
      elif metric_name == "true_negatives":
          return tf.keras.metrics.TrueNegatives(name="true_negatives")
      elif metric_name == "false_negatives":
          return tf.keras.metrics.FalseNegatives(name="false_negatives")
      elif metric_name == "specificity_at_sensitivity":
          return tf.keras.metrics.SpecificityAtSensitivity(
              0.5, name="specificity_at_sensitivity"
          )
      elif metric_name == "sensitivity_at_specificity":
          return tf.keras.metrics.SensitivityAtSpecificity(
              0.5, name="sensitivity_at_specificity"
          )
  
imports: from absl.testing import parameterized
  import apache_beam
  from apache_beam.testing import util
  import numpy
  import tensorflow
  from tensorflow_model_analysis.eval_saved_model import testutil
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.metrics import tf_metric_wrapper
  from tensorflow_model_analysis.proto import config_pb2
label_desc: Use image node_id 1 for calling the ConfusionMatrixMetricsTest obj's underlying member method code with example usage: obj._tf_metric_by_name(metric_name) and returns: tf, tf, tf, tf, tf, tf, tf, tf, tf, tf, tf, tf, tf, tf