class_docstr: Tests that MutualInformation returns the correct AMI value.
class_docstr_tok: ["Tests","that","MutualInformation","returns","the","correct","AMI","value","."]
docstr: Checks that AMI computation is correct.
docstr_tok: ["Checks","that","AMI","computation","is","correct","."]
code: def _assert_ami_output_equal(
      self,
      batch,
      expected,
      schema,
      label_feature,
      normalize_by_max=False,
      allow_invalid_partitions=False,
  ):
      """Checks that AMI computation is correct."""
      actual = mutual_information.MutualInformation(
          label_feature,
          schema,
          TEST_SEED,
          TEST_MAX_ENCODING_LENGTH,
          normalize_by_max=normalize_by_max,
          allow_invalid_partitions=allow_invalid_partitions,
      ).compute(batch)
      test_util.assert_dataset_feature_stats_proto_equal(
          self, actual, expected
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import absltest
  from absl.testing import parameterized
  import apache_beam
  from apache_beam.testing import util
  import numpy
  import pyarrow
  from tensorflow_data_validation import types
  from tensorflow_data_validation.statistics.generators import mutual_information
  from tensorflow_data_validation.statistics.generators import partitioned_stats_generator
  from tensorflow_data_validation.utils import test_util
  from tfx_bsl.arrow import table_util
  from google.protobuf import text_format
  from tensorflow_metadata.proto.v0 import schema_pb2
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 1 for calling the MutualInformationTest obj's underlying member method code with example usage: obj._assert_ami_output_equal(batch, expected, schema, label_feature, normalize_by_max, allow_invalid_partitions) without return types