class_docstr: Computes binary confusion matrix in TFMA.
class_docstr_tok: ["Computes","binary","confusion","matrix","in","TFMA","."]
code: def __init__(
      self,
      key: metric_types.MetricKey,
      eval_config: Optional[config_pb2.EvalConfig],
      thresholds: List[float],
      extract_label_prediction_and_weight: Callable[..., Any],
      example_id_key: Optional[str],
      example_ids_count: int,
      aggregation_type: Optional[metric_types.AggregationType],
      class_weights: Optional[Dict[int, float]],
      example_weighted: bool,
      enable_fractional_labels: bool,
  ):
      self._key = key
      self._eval_config = eval_config
      self._extract_label_prediction_and_weight = (
          extract_label_prediction_and_weight
      )
      self._example_id_key = example_id_key
      self._aggregation_type = aggregation_type
      self._class_weights = class_weights
      self._example_weighted = example_weighted
      self._enable_fractional_labels = enable_fractional_labels
  
      self._binary_confusion_matrices = (
          bcm_computations.BinaryConfusionMatrices(
              thresholds=thresholds,
              example_ids_count=example_ids_count,
              enable_fractional_labels=enable_fractional_labels,
          )
      )
  
imports: from typing import Any, Callable, Dict, Iterable, List, NamedTuple, Optional, Tuple, Union
  import apache_beam
  import numpy
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.contrib.aggregates import binary_confusion_matrices
  from tensorflow_model_analysis.metrics import calibration_histogram
  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 1 to create a new _BinaryConfusionMatrixCombiner object from inherited base classes: beam with example: obj = _BinaryConfusionMatrixCombiner(key, eval_config, thresholds, extract_label_prediction_and_weight, example_id_key, example_ids_count, aggregation_type, class_weights, example_weighted, enable_fractional_labels)