8000 Add a test case for OPTICS bug · scikit-learn/scikit-learn@5de53e1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5de53e1

Browse files
committed
Add a test case for OPTICS bug
1 parent 0c0a9e8 commit 5de53e1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sklearn/cluster/tests/test_optics.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,3 +449,10 @@ def test_precomputed_dists():
449449

450450
assert_allclose(clust1.reachability_, clust2.reachability_)
451451
assert_array_equal(clust1.labels_, clust2.labels_)
452+
453+
def test_processing_order():
454+
Y = [[0],[10],[-10],[25]]
455+
clust = OPTICS(min_samples=3, max_eps=15).fit(Y)
456+
assert_array_equal(clust.reachability_, [np.inf, 10, 10, 15])
457+
assert_array_equal(clust.core_distances_, [10, 15, 20, 25])
458+
assert_array_equal(clust.ordering_, [0, 1, 2, 3])

0 commit comments

Comments
 (0)
0