class_docstr: Tests for SkLearnMutualInformationStatsFn.
code: def test_mi_with_imputed_categorical_label(self):
      label_array = pa.array(
          [["Red"], ["Blue"], ["Red"], None, None, ["Green"], ["Green"]]
      )
      # A categorical feature with missing values.
      feat_array = pa.array(
          [
              ["Red"],
              ["Blue"],
              ["Red"],
              ["Green"],
              ["Blue"],
              ["Green"],
              ["Green"],
          ]
      )
      batch = pa.RecordBatch.from_arrays(
          [label_array, feat_array], ["label_key", "fa"]
      )
  
      schema = text_format.Parse(
          """
          feature {
            name: "label_key"
            type: BYTES
            shape {
              dim {
                size: 1
              }
            }
          }
          feature {
            name: "fa"
            type: BYTES
            shape {
              dim {
                size: 1
              }
            }
          }
          """,
          schema_pb2.Schema(),
      )
  
      expected = text_format.Parse(
          """
          features {
            path {
              step: "fa"
            }
            custom_stats {
              name: 'sklearn_adjusted_mutual_information'
              num: 0.1980421
            }
            custom_stats {
              name: 'sklearn_mutual_information'
              num: 0.8809502
            }
            custom_stats {
              name: "sklearn_normalized_adjusted_mutual_information"
              num: 0.2960819
            }
          }""",
          statistics_pb2.DatasetFeatureStatistics(),
      )
      self._assert_mi_output_equal(
          batch, expected, schema, types.FeaturePath(["label_key"])
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import absltest
  import numpy
  import pyarrow
  from tensorflow_data_validation import types
  from tensorflow_data_validation.statistics.generators import sklearn_mutual_information
  from google.protobuf import text_format
  from tensorflow.python.util.protobuf import compare
  from tensorflow_metadata.proto.v0 import schema_pb2
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 11 for calling the SkLearnMutualInformationTest obj's underlying member method code with example usage: obj.test_mi_with_imputed_categorical_label() without return types