code: def test_make_classification_informative_features():
      """Test the construction of informative features in make_classification
      Also tests `n_clusters_per_class`, `n_classes`, `hypercube` and
      fully-specified `weights`.
      """
      # Create very separate clusters; check that vertices are unique and
      # correspond to classes
      class_sep = 1e6
      make = partial(
          make_classification,
          class_sep=class_sep,
          n_redundant=0,
          n_repeated=0,
          flip_y=0,
          shift=0,
          scale=1,
          shuffle=False,
      )
  
      for n_informative, weights, n_clusters_per_class in [
          (2, [1], 1),
          (2, [1 / 3] * 3, 1),
          (2, [1 / 4] * 4, 1),
          (2, [1 / 2] * 2, 2),
          (2, [3 / 4, 1 / 4], 2),
          (10, [1 / 3] * 3, 10),
          (int(64), [1], 1),
      ]:
          n_classes = len(weights)
          n_clusters = n_classes * n_clusters_per_class
          n_samples = n_clusters * 50
  
          for hypercube in (False, True):
              X, y = make(
                  n_samples=n_samples,
                  n_classes=n_classes,
                  weights=weights,
                  n_features=n_informative,
                  n_informative=n_informative,
                  n_clusters_per_class=n_clusters_per_class,
                  hypercube=hypercube,
                  random_state=0,
              )
  
              assert X.shape == (n_samples, n_informative)
              assert y.shape == (n_samples,)
  
              # Cluster by sign, viewed as strings to allow uniquing
              signs = np.sign(cp.asnumpy(X))
              signs = signs.view(dtype="|S{0}".format(signs.strides[0]))
              unique_signs, cluster_index = np.unique(
                  signs, return_inverse=True
              )
  
              assert (
                  len(unique_signs) == n_clusters
              ), "Wrong number of clusters, or not in distinct quadrants"
  
              # Ensure on vertices of hypercube
              for cluster in range(len(unique_signs)):
                  centroid = X[cluster_index == cluster].mean(axis=0)
                  if hypercube:
                      assert array_equal(
                          cp.abs(centroid) / class_sep,
                          cp.ones(n_informative),
                          1e-5,
                      )
                  else:
                      with pytest.raises(AssertionError):
                          assert array_equal(
                              cp.abs(centroid) / class_sep,
                              cp.ones(n_informative),
                              1e-5,
                          )
  
      with pytest.raises(ValueError):
          make(
              n_features=2,
              n_informative=2,
              n_classes=5,
              n_clusters_per_class=1,
          )
      with pytest.raises(ValueError):
          make(
              n_features=2,
              n_informative=2,
              n_classes=3,
              n_clusters_per_class=2,
          )
  
imports: from cuml.testing.utils import array_equal
  from cuml.datasets.classification import make_classification
  from cuml.internals.safe_imports import gpu_only_import
  import pytest
  from functools import partial
  from cuml.internals.safe_imports import cpu_only_import
label_desc: Use image node_id 2 for calling a global function with example usage: test_make_classification_informative_features() without return types