Skip to content

Commit 5ad4d0e

Browse files
committed
TST: test TypeError in Ward
1 parent bdb32d4 commit 5ad4d0e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sklearn/cluster/tests/test_hierarchical.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ def test_ward_clustering():
8080
clustering.compute_full_tree = False
8181
clustering.fit(X)
8282
np.testing.assert_array_equal(clustering.labels_, labels)
83+
# Check that we raise a TypeError on dense matrices
84+
clustering = Ward(n_clusters=10,
85+
connectivity=connectivity.todense())
86+
assert_raises(TypeError, clustering.fit, X)
8387

8488

8589
def test_ward_agglomeration():

0 commit comments

Comments
 (0)