def test_compare_with_trivial(self): rng = np.random.RandomState(0) n = 20 X = rng.rand(n, 2) d = pdist(X) for method, code in _LINKAGE_METHODS.items(): Z_trivial = _hierarchy.linkage(d, n, code) Z = linkage(d, method) assert_allclose(Z_trivial, Z, rtol=1e-14, atol=1e-15)
def test_compare_with_trivial(self): rng = np.random.RandomState(0) n = 20 X = rng.rand(n, 2) d = pdist(X) for method, code in _LINKAGE_METHODS.items(): Z_trivial = _hierarchy.linkage(d, n, code) Z = linkage(d, method) assert_allclose(Z_trivial, Z, rtol=1e-14, atol=1e-15)