Skip to content

Commit

Permalink
Avoid using global random state
Browse files Browse the repository at this point in the history
  • Loading branch information
vighneshbirodkar committed Feb 29, 2016
1 parent 562dffe commit 58d5e48
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sklearn/decomposition/tests/test_dict_learning.py
Expand Up @@ -244,7 +244,8 @@ def test_sparse_coder_mmap():
# Test that SparseCoder does not error by passing reading only
# arrays to child processes

init_dict = np.random.rand(500, 64)
rng = np.random.RandomState(777)
init_dict = rng.rand(500, 64)
data = np.random.rand(8096, 64)
sc = SparseCoder(init_dict, transform_algorithm='omp', n_jobs=2)
sc.fit_transform(data)

0 comments on commit 58d5e48

Please sign in to comment.