code: def testCorrelatedGaussians(self):
      # The mutual information between correlated Gaussian random variables can be
      # theoretically computed, which provides a nice test for the code.
      rho = 0.4
      [f0, f1], expected = self._MakeCorrelatedFeatures([10, 20], rho)
      result = _MI(
          [f0],
          [f1],
          [False],
          [False],
          estimate_method="smaller_data",
          seed=21,
      )
      self.assertAlmostEqual(result, expected, places=2)
      result = _MI(
          [f0],
          [f1],
          [False],
          [False],
          estimate_method="larger_data",
          seed=21,
      )
      self.assertAlmostEqual(result, expected, places=2)
  
      # Higher dimension.
      rho = 0.9  # fairly strongly dependent features
      [f0, f1, f2, f3], expected = self._MakeCorrelatedFeatures(
          [1, 2, -3, 4], rho
      )
  
      for method in ["smaller_data", "larger_data"]:
          result = _MI(
              [f1, f2, f3],
              [f0],
              [False] * 3,
              [False],
              estimate_method=method,
              seed=21,
          )
          self.assertAlmostEqual(result, expected, delta=2e-2)
  
imports: from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  from tensorflow_data_validation.utils import mutual_information_util
label_desc: Use image node_id 4 for calling the RanklabMutualInformationTest obj's underlying member method code with example usage: obj.testCorrelatedGaussians() without return types