Skip to content

Commit

Permalink
Tests: Fix seed of numpy.random
Browse files Browse the repository at this point in the history
  • Loading branch information
andreArtelt committed Jul 15, 2019
1 parent ba29718 commit 299b169
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/sklearn/test_sklearn_isolationforest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import numpy as np
np.random.seed(42)
from sklearn.ensemble import IsolationForest
from sklearn.datasets import make_blobs

Expand Down
1 change: 1 addition & 0 deletions tests/sklearn/test_sklearn_knn.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
sys.path.insert(0,'..')

import numpy as np
np.random.seed(42)
import sklearn
from sklearn.datasets import load_iris, load_boston
from sklearn.model_selection import train_test_split
Expand Down
1 change: 1 addition & 0 deletions tests/sklearn/test_sklearn_linearregression.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
sys.path.insert(0,'..')

import numpy as np
np.random.seed(42)
import sklearn
from sklearn.datasets import load_boston
from sklearn.model_selection import train_test_split
Expand Down
1 change: 1 addition & 0 deletions tests/sklearn/test_sklearn_lvq.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
sys.path.insert(0,'..')

import numpy as np
np.random.seed(42)
import sklearn
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
Expand Down
1 change: 1 addition & 0 deletions tests/sklearn/test_sklearn_naivebayes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
sys.path.insert(0,'..')

import numpy as np
np.random.seed(42)
import sklearn
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
Expand Down
1 change: 1 addition & 0 deletions tests/sklearn/test_sklearn_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
sys.path.insert(0,'..')

import numpy as np
np.random.seed(42)
import sklearn
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
Expand Down
1 change: 1 addition & 0 deletions tests/sklearn/test_sklearn_randomforest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
sys.path.insert(0,'..')

import numpy as np
np.random.seed(42)
import sklearn
from sklearn.datasets import load_iris, load_boston
from sklearn.model_selection import train_test_split
Expand Down
1 change: 1 addition & 0 deletions tests/sklearn/test_sklearn_softmaxregression.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
sys.path.insert(0,'..')

import numpy as np
np.random.seed(42)
import sklearn
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
Expand Down
1 change: 1 addition & 0 deletions tests/tfkeras/test_tfkeras_linearregression.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
tf.random.set_random_seed(42)

import numpy as np
np.random.seed(42)
from sklearn.datasets import load_boston
from sklearn.model_selection import train_test_split
from sklearn.metrics import r2_score
Expand Down
1 change: 1 addition & 0 deletions tests/tfkeras/test_tfkeras_softmaxregression.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
tf.compat.v1.random.set_random_seed(42)

import numpy as np
np.random.seed(42)
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
Expand Down
1 change: 1 addition & 0 deletions tests/torch/test_torch_linearregression.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import torch
torch.manual_seed(42)
import numpy as np
np.random.seed(42)
from sklearn.datasets import load_boston
from sklearn.model_selection import train_test_split
from sklearn.metrics import r2_score
Expand Down
1 change: 1 addition & 0 deletions tests/torch/test_torch_softmaxregression.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import torch
torch.manual_seed(42)
import numpy as np
np.random.seed(42)
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
Expand Down

0 comments on commit 299b169

Please sign in to comment.