code: def default_regression_specs(
      model_names: Optional[List[str]] = None,
      output_names: Optional[List[str]] = None,
      output_weights: Optional[Dict[str, float]] = None,
      loss_functions: Optional[
          List[Union[tf.keras.metrics.Metric, tf.keras.losses.Loss]]
      ] = None,
      min_value: Optional[float] = None,
      max_value: Optional[float] = None,
  ) -> List[config_pb2.MetricsSpec]:
      """Returns default metric specs for for regression 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).
        loss_functions: Loss functions to use (if None MSE is used).
        min_value: Min value for calibration plot (if None no plot will be created).
        max_value: Max value for calibration plot (if None no plot will be created).
      """
  
      if loss_functions is None:
          loss_functions = [
              tf.keras.metrics.MeanSquaredError(name="mse")
          ]
  
      metrics = [
          tf.keras.metrics.Accuracy(name="accuracy"),
          calibration.MeanLabel(name="mean_label"),
          calibration.MeanPrediction(name="mean_prediction"),
          calibration.Calibration(name="calibration"),
      ]
      for fn in loss_functions:
          metrics.append(fn)
      if min_value is not None and max_value is not None:
          metrics.append(
              calibration_plot.CalibrationPlot(
                  name="calibration_plot",
                  left=min_value,
                  right=max_value,
              )
          )
  
      return specs_from_metrics(
          metrics,
          model_names=model_names,
          output_names=output_names,
          output_weights=output_weights,
      )
  
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 6 for calling a global function with example usage: default_regression_specs(model_names, output_names, output_weights, loss_functions, min_value, max_value) and returns: specs_from_metrics