Skip to content

[FIX] bug test kmedoids #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions sklearn_extra/cluster/tests/test_k_medoids.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,11 @@ def test_precomputed():
kmedoids.fit(D_1)

assert_allclose(kmedoids.inertia_, 0.2)
assert_array_equal(kmedoids.medoid_indices_, [2, 0])
assert_array_equal(kmedoids.labels_, [1, 1, 0, 0])
assert_array_equal(
np.sort(kmedoids.medoid_indices_), np.sort([2, 0])
) # the order may change
assert kmedoids.labels_[0] == kmedoids.labels_[1]
assert kmedoids.labels_[2] == kmedoids.labels_[3]
assert kmedoids.cluster_centers_ is None

med_1, med_2 = tuple(kmedoids.medoid_indices_)
Expand Down