Skip to content

Commit c0a0e31

Browse files
committed
ENH make spectral clustering test more stable to random seed
1 parent 76ae2fa commit c0a0e31

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sklearn/cluster/tests/test_spectral.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,9 @@ def test_affinities():
159159
# Note: in the following, random_state has been selected to have
160160
# a dataset that yields a stable eigen decomposition both when built
161161
# on OSX and Linux
162-
X, y = make_blobs(n_samples=40, random_state=2,
163-
centers=[[1, 1], [-1, -1]], cluster_std=0.4)
162+
X, y = make_blobs(n_samples=20, random_state=0,
163+
centers=[[1, 1], [-1, -1]], cluster_std=0.01
164+
)
164165
# nearest neighbors affinity
165166
sp = SpectralClustering(n_clusters=2, affinity='nearest_neighbors',
166167
random_state=0)

0 commit comments

Comments
 (0)