Skip to content

Commit 9e4aba2

Browse files
author
Jan Hendrik Metzen
committed
FIX Using random_state.rand rather than scipy.rand consistently in Gaussian Process
1 parent 2912384 commit 9e4aba2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sklearn/gaussian_process/gaussian_process.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from __future__ import print_function
88

99
import numpy as np
10-
from scipy import linalg, optimize, rand
10+
from scipy import linalg, optimize
1111

1212
from ..base import BaseEstimator, RegressorMixin
1313
from ..metrics.pairwise import manhattan_distances
@@ -721,8 +721,9 @@ def minus_reduced_likelihood_function(log10t):
721721
# Generate a random starting point log10-uniformly
722722
# distributed between bounds
723723
log10theta0 = np.log10(self.thetaL) \
724-
+ rand(self.theta0.size).reshape(self.theta0.shape) \
725-
* np.log10(self.thetaU / self.thetaL)
724+
+ self.random_state.rand(self.theta0.size).reshape(
725+
self.theta0.shape) * np.log10(self.thetaU
726+
/ self.thetaL)
726727
theta0 = 10. ** log10theta0
727728

728729
# Run Cobyla

0 commit comments

Comments
 (0)