docstr: Tests if the masked positions are uniformly distributed.
docstr_tok: ["Tests","if","the","masked","positions","are","uniformly","distributed","."]
code: def test_sample_masks_returns_uniformly_distributed_masks(self):
      """Tests if the masked positions are uniformly distributed."""
      num_samples = 10000
      num_features = 100
      masks = lime.sample_masks(num_samples, num_features, seed=0)
      # The mean should be ~0.5, but this is also true when normally distributed.
      np.testing.assert_almost_equal(masks.mean(), 0.5, decimal=2)
      # We should see each possible masked count approx. the same number of times.
      # We check this by looking at the entropy which should be around 1.0.
      counter = collections.Counter(masks.sum(axis=-1))
      entropy = stats.entropy(list(counter.values()), base=num_features)
      np.testing.assert_almost_equal(entropy, 1.0, decimal=2)
  
imports: import collections
  import functools
  from absl.testing import absltest
  from absl.testing import parameterized
  from lime import lime_text
  from lit_nlp.components.citrus import lime
  from lit_nlp.components.citrus import utils
  import numpy
  from scipy import special
  from scipy import stats
label_desc: Use image node_id 3 for calling the LimeTest obj's underlying member method code with example usage: obj.test_sample_masks_returns_uniformly_distributed_masks() without return types