class_docstr: Creates multi-label confusion matrix at thresholds from standard inputs.
class_docstr_tok: ["Creates","multi-label","confusion","matrix","at","thresholds","from","standard","inputs","."]
code: def extract_output(
      self, accumulator: _Matrices
  ) -> Dict[
      metric_types.PlotKey,
      metrics_for_slice_pb2.MultiLabelConfusionMatrixAtThresholds,
  ]:
      pb = metrics_for_slice_pb2.MultiLabelConfusionMatrixAtThresholds()
      for threshold in sorted(accumulator):
          # Convert -epsilon and 1.0+epsilon back to 0.0 and 1.0.
          if threshold == -_EPSILON:
              t = 0.0
          elif threshold == 1.0 + _EPSILON:
              t = 1.0
          else:
              t = threshold
          matrix = pb.matrices.add(threshold=t)
          for k in sorted(accumulator[threshold]):
              matrix.entries.add(
                  actual_class_id=k.actual_class_id,
                  predicted_class_id=k.predicted_class_id,
                  false_negatives=accumulator[threshold][
                      k
                  ].false_negatives,
                  true_negatives=accumulator[threshold][
                      k
                  ].true_negatives,
                  false_positives=accumulator[threshold][
                      k
                  ].false_positives,
                  true_positives=accumulator[threshold][
                      k
                  ].true_positives,
              )
      return {self._key: pb}
  
file_path: model-analysis/tensorflow_model_analysis/metrics/multi_label_confusion_matrix_plot.py
imports: from typing import Dict, Iterable, List, Optional, NamedTuple
  import apache_beam
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.proto import metrics_for_slice_pb2
label_desc: Use image node_id 5 for calling the _MultiLabelConfusionMatrixPlotCombiner obj's underlying member method code with example usage: obj.extract_output(accumulator) and returns: dict