Skip to content

Commit

Permalink
Merge branch 'branch-25.02' into kmeans-auto-2
Browse files Browse the repository at this point in the history
  • Loading branch information
betatim authored Dec 20, 2024
2 parents cc67668 + 5bc1328 commit ad38a70
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/cuml/cuml/tests/test_kmeans.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def test_weighted_kmeans(nrows, ncols, nclusters, max_weight, random_state):
sk_kmeans.fit(cp.asnumpy(X), sample_weight=wt)
sk_score = sk_kmeans.score(cp.asnumpy(X))

assert abs(cu_score - sk_score) <= cluster_std * 1.5
assert cu_score - sk_score <= cluster_std * 1.5


@pytest.mark.parametrize("nrows", [1000, 10000])
Expand Down Expand Up @@ -443,5 +443,6 @@ def test_fit_transform_weighted_kmeans(
sk_transf = sk_kmeans.fit_transform(cp.asnumpy(X), sample_weight=wt)
sk_score = sk_kmeans.score(cp.asnumpy(X))

assert abs(cu_score - sk_score) <= cluster_std * 1.5
# we fail if cuML's score is significantly worse than sklearn's
assert cu_score - sk_score <= cluster_std * 1.5
assert sk_transf.shape == cuml_transf.shape

0 comments on commit ad38a70

Please sign in to comment.