8000 Avoid using global random state · scikit-learn/scikit-learn@58d5e48 · GitHub
[go: up one dir, main page]

Skip to content

Commit 58d5e48

Browse files
Avoid using global random state
1 parent 562dffe commit 58d5e48

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sklearn/decomposition/tests/test_dict_learning.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,8 @@ def test_sparse_coder_mmap():
244244
# Test that SparseCoder does not error by passing reading only
245245
# arrays to child processes
246246

247-
init_dict = np.random.rand(500, 64)
247+
rng = np.random.RandomState(777)
248+
init_dict = rng.rand(500, 64)
248249
data = np.random.rand(8096, 64)
249250
sc = SparseCoder(init_dict, transform_algorithm='omp', n_jobs=2)
250251
sc.fit_transform(data)

0 commit comments

Comments
 (0)
0