code: def testToComputationsWithMixedAggregationAndNonAggregationMetrics(
      self,
  ):
      computations = metric_specs.to_computations(
          [
              config_pb2.MetricsSpec(
                  metrics=[
                      config_pb2.MetricConfig(
                          class_name="CategoricalAccuracy"
                      )
                  ]
              ),
              config_pb2.MetricsSpec(
                  metrics=[
                      config_pb2.MetricConfig(
                          class_name="BinaryCrossentropy"
                      )
                  ],
                  binarize=config_pb2.BinarizationOptions(
                      class_ids={"values": [1]}
                  ),
                  aggregate=config_pb2.AggregationOptions(
                      micro_average=True
                  ),
              ),
          ],
          config_pb2.EvalConfig(),
      )
  
      # 3 separate computations should be used (one for aggregated metrics, one
      # for non-aggregated metrics, and one for metrics associated with class 1)
      self.assertLen(computations, 3)
  
file_path: model-analysis/tensorflow_model_analysis/metrics/metric_specs_test.py
imports: import json
  import tensorflow
  from tensorflow_model_analysis.metrics import calibration
  from tensorflow_model_analysis.metrics import confusion_matrix_metrics
  from tensorflow_model_analysis.metrics import mean_regression_error
  from tensorflow_model_analysis.metrics import metric_specs
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.proto import config_pb2
label_desc: Use image node_id 5 for calling the MetricSpecsTest obj's underlying member method code with example usage: obj.testToComputationsWithMixedAggregationAndNonAggregationMetrics() without return types