andrewssobral
commited on
Commit
•
c4224de
1
Parent(s):
de41f58
Fix numpy random seed
Browse files
scikit-learn/adaboost_regressor/train.py
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
# -*- coding: utf-8 -*-
|
3 |
|
4 |
import joblib
|
|
|
5 |
|
6 |
from sklearn.datasets import fetch_california_housing
|
7 |
from sklearn.ensemble import AdaBoostRegressor
|
@@ -9,6 +10,7 @@ from sklearn.model_selection import train_test_split
|
|
9 |
|
10 |
# Set the random seed
|
11 |
random_seed = 0
|
|
|
12 |
|
13 |
# Load the dataset
|
14 |
dataset = fetch_california_housing()
|
|
|
2 |
# -*- coding: utf-8 -*-
|
3 |
|
4 |
import joblib
|
5 |
+
import numpy as np
|
6 |
|
7 |
from sklearn.datasets import fetch_california_housing
|
8 |
from sklearn.ensemble import AdaBoostRegressor
|
|
|
10 |
|
11 |
# Set the random seed
|
12 |
random_seed = 0
|
13 |
+
np.random.seed(random_seed)
|
14 |
|
15 |
# Load the dataset
|
16 |
dataset = fetch_california_housing()
|
scikit-learn/bayesian_ridge/train.py
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
# -*- coding: utf-8 -*-
|
3 |
|
4 |
import joblib
|
|
|
5 |
|
6 |
from sklearn.datasets import fetch_california_housing
|
7 |
from sklearn.linear_model import BayesianRidge
|
@@ -9,6 +10,7 @@ from sklearn.model_selection import train_test_split
|
|
9 |
|
10 |
# Set the random seed
|
11 |
random_seed = 0
|
|
|
12 |
|
13 |
# Load the dataset
|
14 |
dataset = fetch_california_housing()
|
|
|
2 |
# -*- coding: utf-8 -*-
|
3 |
|
4 |
import joblib
|
5 |
+
import numpy as np
|
6 |
|
7 |
from sklearn.datasets import fetch_california_housing
|
8 |
from sklearn.linear_model import BayesianRidge
|
|
|
10 |
|
11 |
# Set the random seed
|
12 |
random_seed = 0
|
13 |
+
np.random.seed(random_seed)
|
14 |
|
15 |
# Load the dataset
|
16 |
dataset = fetch_california_housing()
|
scikit-learn/catboost_regressor/train.py
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
# -*- coding: utf-8 -*-
|
3 |
|
4 |
import joblib
|
|
|
5 |
|
6 |
from catboost import CatBoostRegressor
|
7 |
from sklearn.datasets import fetch_california_housing
|
@@ -9,6 +10,7 @@ from sklearn.model_selection import train_test_split
|
|
9 |
|
10 |
# Set the random seed
|
11 |
random_seed = 0
|
|
|
12 |
|
13 |
# Load the dataset
|
14 |
dataset = fetch_california_housing()
|
|
|
2 |
# -*- coding: utf-8 -*-
|
3 |
|
4 |
import joblib
|
5 |
+
import numpy as np
|
6 |
|
7 |
from catboost import CatBoostRegressor
|
8 |
from sklearn.datasets import fetch_california_housing
|
|
|
10 |
|
11 |
# Set the random seed
|
12 |
random_seed = 0
|
13 |
+
np.random.seed(random_seed)
|
14 |
|
15 |
# Load the dataset
|
16 |
dataset = fetch_california_housing()
|
scikit-learn/gaussian_nb/train.py
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
# -*- coding: utf-8 -*-
|
3 |
|
4 |
import joblib
|
|
|
5 |
|
6 |
from sklearn.datasets import load_iris
|
7 |
from sklearn.model_selection import train_test_split
|
@@ -9,6 +10,7 @@ from sklearn.naive_bayes import GaussianNB
|
|
9 |
|
10 |
# Set the random seed
|
11 |
random_seed = 0
|
|
|
12 |
|
13 |
# Load the dataset
|
14 |
dataset = load_iris()
|
|
|
2 |
# -*- coding: utf-8 -*-
|
3 |
|
4 |
import joblib
|
5 |
+
import numpy as np
|
6 |
|
7 |
from sklearn.datasets import load_iris
|
8 |
from sklearn.model_selection import train_test_split
|
|
|
10 |
|
11 |
# Set the random seed
|
12 |
random_seed = 0
|
13 |
+
np.random.seed(random_seed)
|
14 |
|
15 |
# Load the dataset
|
16 |
dataset = load_iris()
|