code: def default_binary_classification_specs(
      model_names: Optional[List[str]] = None,
      output_names: Optional[List[str]] = None,
      output_weights: Optional[Dict[str, float]] = None,
      binarize: Optional[config_pb2.BinarizationOptions] = None,
      aggregate: Optional[config_pb2.AggregationOptions] = None,
      include_loss: bool = True,
  ) -> List[config_pb2.MetricsSpec]:
      """Returns default metric specs for binary classification problems.
  
      Args:
        model_names: Optional model names (if multi-model evaluation).
        output_names: Optional list of output names (if multi-output model).
        output_weights: Optional output weights for creating overall metric
          aggregated across outputs (if multi-output model). If a weight is not
          provided for an output, it's weight defaults to 0.0 (i.e. output ignored).
        binarize: Optional settings for binarizing multi-class/multi-label metrics.
        aggregate: Optional settings for aggregating multi-class/multi-label
          metrics.
        include_loss: True to include loss.
      """
  
      metrics = [
          confusion_matrix_metrics.BinaryAccuracy(
              name="binary_accuracy"
          ),
          confusion_matrix_metrics.AUC(
              name="auc",
              num_thresholds=binary_confusion_matrices.DEFAULT_NUM_THRESHOLDS,
          ),
          confusion_matrix_metrics.AUC(
              name="auc_precison_recall",  # Matches default name used by estimator.
              curve="PR",
              num_thresholds=binary_confusion_matrices.DEFAULT_NUM_THRESHOLDS,
          ),
          confusion_matrix_metrics.Precision(name="precision"),
          confusion_matrix_metrics.Recall(name="recall"),
          calibration.MeanLabel(name="mean_label"),
          calibration.MeanPrediction(name="mean_prediction"),
          calibration.Calibration(name="calibration"),
          confusion_matrix_plot.ConfusionMatrixPlot(
              name="confusion_matrix_plot"
          ),
          calibration_plot.CalibrationPlot(name="calibration_plot"),
      ]
      if include_loss:
          metrics.append(
              tf.keras.metrics.BinaryCrossentropy(name="loss")
          )
  
      return specs_from_metrics(
          metrics,
          model_names=model_names,
          output_names=output_names,
          output_weights=output_weights,
          binarize=binarize,
          aggregate=aggregate,
      )
  
imports: import collections
  import importlib
  import json
  import re
  from typing import Any, Dict, FrozenSet, Iterable, Iterator, List, NamedTuple, Optional, Tuple, Type, Union
  import tensorflow
  from tensorflow_model_analysis.metrics import aggregation
  from tensorflow_model_analysis.metrics import binary_confusion_matrices
  from tensorflow_model_analysis.metrics import calibration
  from tensorflow_model_analysis.metrics import calibration_plot
  from tensorflow_model_analysis.metrics import confusion_matrix_metrics
  from tensorflow_model_analysis.metrics import confusion_matrix_plot
  from tensorflow_model_analysis.metrics import example_count
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.metrics import multi_class_confusion_matrix_plot
  from tensorflow_model_analysis.metrics import tf_metric_wrapper
  from tensorflow_model_analysis.metrics import weighted_example_count
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.slicer import slicer_lib
  from tensorflow_model_analysis.utils import model_util
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 7 for calling a global function with example usage: default_binary_classification_specs(model_names, output_names, output_weights, binarize, aggregate, include_loss) and returns: specs_from_metrics