Skip to content

Commit 2ab257a

Browse files
committed
Test of all_points_membership_vectors
1 parent e653f09 commit 2ab257a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

hdbscan/tests/test_hdbscan.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,15 @@ def test_hdbscan_membership_vector():
462462
vector = membership_vector(clusterer, np.array([[0.0, 0.0]]))
463463
assert_array_almost_equal(vector, np.array([[ 0.03545607, 0.03363318, 0.04643177]]))
464464

465+
def test_hdbscan_all_points_membership_vectors():
466+
clusterer = HDBSCAN(prediction_data=True).fit(X)
467+
vects = all_points_membership_vectors(clusterer)
468+
assert_array_almost_equal(vects[0], np.array([7.86400992e-002,
469+
2.52734246e-001,
470+
8.38299608e-002]))
471+
assert_array_almost_equal(vects[-1], np.array([8.09055344e-001,
472+
8.35882503e-002,
473+
1.07356406e-001]))
465474

466475
def test_hdbscan_badargs():
467476
assert_raises(ValueError,

0 commit comments

Comments
 (0)