class_docstr: The base metric for semantic segmentation confusion matrix based metrics.
  
  This is the base metric for other metrics such as true postive, true negative,
  false positvie and false negative.
class_docstr_tok: ["The","base","metric","for","semantic","segmentation","confusion","matrix","based","metrics",".","This","is","the","base","metric","for","other","metrics","such","as","true","postive",",","true","negative",",","false","positvie","and","false","negative","."]
docstr: Returns the metric value based the confusion matrix.
  
     Subclasses must override this method.
  Args:
    matrix: The matrix to calculate derived values.
  
  Return: The values calculated based on a confusion matrix.
docstr_tok: ["Returns","the","metric","value","based","the","confusion","matrix",".","Subclasses","must","override","this","method",".","Args",":","matrix",":","The","matrix","to","calculate","derived","values",".","Return",":","The","values","calculated","based","on","a","confusion","matrix","."]
code: def _metric_value(
      self,
      matrix: Matrix,
  ) -> Union[float, np.ndarray]:
      """Returns the metric value based the confusion matrix.
  
         Subclasses must override this method.
      Args:
        matrix: The matrix to calculate derived values.
  
      Return: The values calculated based on a confusion matrix.
      """
      raise NotImplementedError(
          "Must be implemented to return a metric value"
      )
  
imports: import abc
  from typing import Any, Dict, Iterable, List, Optional, Union
  import apache_beam
  import numpy
  from tensorflow_model_analysis.contrib.aggregates import binary_confusion_matrices
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.metrics import preprocessors
  from tensorflow_model_analysis.proto import config_pb2
label_desc: Use image node_id 3 for calling the SemanticSegmentationConfusionMatrixMetricBase obj's underlying member method code with example usage: obj._metric_value(matrix) without return types