Skip to content

Commit

Permalink
Simplify return_inverse fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
seberg authored Jul 11, 2024
1 parent 474d8e9 commit 1e912c0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions python/cuml/tests/test_make_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,8 @@ def test_make_classification_informative_features():

# 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]))
signs = signs.view(dtype="|S{0}".format(signs.strides[0])).ravel()
unique_signs, cluster_index = np.unique(signs, return_inverse=True)
# NumPy 2 has a behavior change (maybe regression) for the inverse shape
# https://github.com/numpy/numpy/issues/26738. This always works:
cluster_index = cluster_index.reshape(-1)

assert (
len(unique_signs) == n_clusters
Expand Down

0 comments on commit 1e912c0

Please sign in to comment.