You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GaussianProcess with batch_size gives "'float' object cannot be interpreted as an integer" #6483
import numpy as np
from sklearn.gaussian_process import GaussianProcess
X = np.random.rand(100, 3)
y = np.random.rand(100)
gp = GaussianProcess().fit(X, y)
gp.predict(X, batch_size=5)
Results in the error
'float' object cannot be interpreted as an integer
Because of:
C:\...\lib\site-packages\sklearn\gaussian_process\gaussian_process.py in predict(self, X, eval_MSE, batch_size)
520
521 y = np.zeros(n_eval)
--> 522 for k in range(max(1, n_eval / batch_size)):
523 batch_from = k * batch_size
524 batch_to = min([(k + 1) * batch_size + 1, n_eval + 1])
TypeError: 'float' object cannot be interpreted as an integer
GaussianProcess has been deprecated in 0.18. If this is possible for you, please update to the dev version, where will now find GaussianProcessRegressor instead.
oh thanks, I didn't know the GaussianProcess class was deprecated (there's no warning anywhere). Wish I could try the new one in 0.18, but I cannot use dev versions in production.
Will there be a 0.17.2 release before 0.18? The fix would be trivial - I think replacing the division "/" by "//" should do it..
No, this is correct. The new GP implementation has been added after the 0.17 release, and therefore the old implementation will be deprecated in 0.20, two release cycles after the next 0.18 release.
GaussianProcess is deprecated starting from 0.18 but it is still there until 0.20, where it will be entirely removied.
Activity
glouppe commentedon Mar 4, 2016
GaussianProcesshas been deprecated in 0.18. If this is possible for you, please update to the dev version, where will now findGaussianProcessRegressorinstead.stmax82 commentedon Mar 4, 2016
oh thanks, I didn't know the GaussianProcess class was deprecated (there's no warning anywhere). Wish I could try the new one in 0.18, but I cannot use dev versions in production.
Will there be a 0.17.2 release before 0.18? The fix would be trivial - I think replacing the division "/" by "//" should do it..
nelson-liu commentedon Mar 4, 2016
@glouppe according to the docstring at https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/gaussian_process/gaussian_process.py#L61, it will be deprecated in 0.20. Is this an error in the docstring?
glouppe commentedon Mar 4, 2016
No, this is correct. The new GP implementation has been added after the 0.17 release, and therefore the old implementation will be deprecated in 0.20, two release cycles after the next 0.18 release.
GaussianProcessis deprecated starting from 0.18 but it is still there until 0.20, where it will be entirely removied.nelson-liu commentedon Mar 4, 2016
ah that makes sense, thanks for the info.
Fixed batch gaussian process