code: def test_keras_binary_classification_model(self, correlation_type):
      metric = correlation_type()
      inputs = tf.keras.layers.Input(shape=(128,))
      outputs = tf.keras.layers.Dense(1, activation="sigmoid")(inputs)
      model = tf.keras.models.Model(inputs, outputs)
      if hasattr(tf.keras.optimizers, "legacy"):
          optimizer = tf.keras.optimizers.legacy.Adam(learning_rate=0.1)
      else:
          optimizer = tf.keras.optimizers.Adam(learning_rate=0.1)
      model.compile(
          optimizer=optimizer,
          loss="binary_crossentropy",
          metrics=[metric],
      )
  
      x = np.random.rand(1024, 128).astype(np.float32)
      y = np.random.randint(2, size=(1024, 1)).astype(np.float32)
  
      history = model.fit(
          x,
          y,
          epochs=1,
          verbose=0,
          batch_size=32,
          validation_data=(x, y),
      )
  
      metric_history = history.history["val_" + metric.name]
  
      preds = model(x)
      metric.reset_state()
      # we decorate with tf.function to ensure the metric is also checked against graph mode.
      # keras automatically decorates the metrics compiled within keras.Model.
      metric.update_state(y, preds)
      metric_value = tf.function(metric.result)()
      scipy_value = self.scipy_corr[correlation_type](
          preds[:, 0], y[:, 0]
      )[0]
      np.testing.assert_almost_equal(
          metric_value, metric_history[-1], decimal=6
      )
      np.testing.assert_almost_equal(
          metric_value, scipy_value, decimal=2
      )
  
file_path: addons/tensorflow_addons/metrics/tests/streaming_correlations_test.py
imports: import pytest
  import numpy
  import tensorflow
  from scipy import stats
  from tensorflow_addons.metrics import KendallsTauB
  from tensorflow_addons.metrics import KendallsTauC
  from tensorflow_addons.metrics import PearsonsCorrelation
  from tensorflow_addons.metrics import SpearmansRank
  from tensorflow_addons.testing.serialization import check_metric_serialization
label_desc: Use image node_id 6 for calling the TestStreamingCorrelations obj's underlying member method code with example usage: obj.test_keras_binary_classification_model(correlation_type) without return types