scikit-learn-contrib / hdbscan

A high performance implementation of HDBSCAN clustering.
http://hdbscan.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
2.81k stars 506 forks source link

Flaky tests test_hdbscan_boruvka_balltree and test_hdbscan_best_balltree_metric #570

Open gmacon opened 2 years ago

gmacon commented 2 years ago

I got these two test failures during a test run, but they passed when I ran the tests a second time:

________________________ test_hdbscan_boruvka_balltree _________________________

    def test_hdbscan_boruvka_balltree():
        labels, p, persist, ctree, ltree, mtree = hdbscan(
            X, algorithm='boruvka_balltree')
        n_clusters_1 = len(set(labels)) - int(-1 in labels)
>       assert(n_clusters_1 == n_clusters)
E       assert 6 == 3

test_hdbscan.py:222: AssertionError
______________________ test_hdbscan_best_balltree_metric _______________________

    def test_hdbscan_best_balltree_metric():
        labels, p, persist, ctree, ltree, mtree = hdbscan(X, metric='seuclidean',
                                                          V=np.ones(X.shape[1]))
        n_clusters_1 = len(set(labels)) - int(-1 in labels)
>       assert(n_clusters_1 == n_clusters)
E       assert 6 == 3

test_hdbscan.py:265: AssertionError

Edit: I realize I should say: on macOS 11.7 ("Big Sur") with Python 3.9 and hdbscan 0.8.27.