code: def test_outlier_sensitivity(self):
      gen = np.random.default_rng(44)
      array1 = gen.standard_normal(10000)
      array2 = np.concatenate([array1, np.array([1e8])])
      js_quantiles = get_js(
          array1, array2, schema_pb2.HistogramSelection.QUANTILES
      )
      js_quantiles_100 = get_js(
          array1, array2, schema_pb2.HistogramSelection.QUANTILES, 100
      )
      js_standard = get_js(
          array1, array2, schema_pb2.HistogramSelection.STANDARD
      )
      js_standard_100 = get_js(
          array1, array2, schema_pb2.HistogramSelection.STANDARD, 100
      )
      # The idealized JS is very close to zero, but in practice we expect a value
      # around 0.1 because there are only ten bins, and the last bin is affected
      # by the outlier.
      self.assertLess(js_quantiles, 0.15)
      # QUANTILES JS with more bins is better here.
      self.assertLess(js_quantiles_100, 0.02)
      # STANDARD JS is very affected by outliers.
      self.assertGreater(js_standard, 0.99)
      # Adding more bins doesn't help.
      self.assertGreater(js_standard_100, 0.99)
  
file_path: data-validation/tensorflow_data_validation/integration_tests/drift_skew_metrics_test.py
imports: from absl import flags
  from absl.testing import absltest
  import numpy
  import pandas
  import tensorflow_data_validation
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 2 for calling the DriftSkewMetricsTest obj's underlying member method code with example usage: obj.test_outlier_sensitivity() without return types