class_docstr: Unit tests for the clustering_centroids module.
class_docstr_tok: ["Unit","tests","for","the","clustering_centroids","module","."]
code: def testRandomClusterCentroidsWithSparsityPreservation(
      self, weights, number_of_clusters
  ):
      dbci = clustering_centroids.RandomCentroidsInitialisation(
          weights, number_of_clusters, preserve_sparsity=True
      )
      calc_centroids = K.batch_get_value(
          [dbci.get_cluster_centroids()]
      )[0]
      self.assertContainsSubset(
          [0.0],
          calc_centroids,
          msg="The centroids must include the zero-point cluster",
      )
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_model_optimization.python.core.clustering.keras import cluster_config
  from tensorflow_model_optimization.python.core.clustering.keras import clustering_centroids
label_desc: Use image node_id 15 for calling the ClusteringCentroidsTest obj's underlying member method code with example usage: obj.testRandomClusterCentroidsWithSparsityPreservation(weights, number_of_clusters) without return types