<h4 dir="auto">Description</h4>
<p dir="auto">GaussianProcess batch predict fail on py3 due to range(float)</p>
<h4 dir="auto">Steps/Code to Reproduce</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np
import sklearn.datasets
from sklearn import gaussian_process

digits = sklearn.datasets.load_digits()

X = digits.data
y = digits.target

indices = np.arange(X.shape[0])
np.random.shuffle(indices)
X = X[indices]
y = y[indices]
X_train = X[:1000]
y_train = y[:1000]
X_test = X[1000:]
y_test = y[1000:]

gp = gaussian_process.GaussianProcess()
gp.fit(X_train, y_train)

gp.predict(X_test, batch_size=100)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-k">import</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">datasets</span>
<span class="pl-k">from</span> <span class="pl-s1">sklearn</span> <span class="pl-k">import</span> <span class="pl-s1">gaussian_process</span>

<span class="pl-s1">digits</span> <span class="pl-c1">=</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">datasets</span>.<span class="pl-en">load_digits</span>()

<span class="pl-v">X</span> <span class="pl-c1">=</span> <span class="pl-s1">digits</span>.<span class="pl-s1">data</span>
<span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">digits</span>.<span class="pl-s1">target</span>

<span class="pl-s1">indices</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">arange</span>(<span class="pl-v">X</span>.<span class="pl-s1">shape</span>[<span class="pl-c1">0</span>])
<span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">shuffle</span>(<span class="pl-s1">indices</span>)
<span class="pl-v">X</span> <span class="pl-c1">=</span> <span class="pl-v">X</span>[<span class="pl-s1">indices</span>]
<span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">y</span>[<span class="pl-s1">indices</span>]
<span class="pl-v">X_train</span> <span class="pl-c1">=</span> <span class="pl-v">X</span>[:<span class="pl-c1">1000</span>]
<span class="pl-s1">y_train</span> <span class="pl-c1">=</span> <span class="pl-s1">y</span>[:<span class="pl-c1">1000</span>]
<span class="pl-v">X_test</span> <span class="pl-c1">=</span> <span class="pl-v">X</span>[<span class="pl-c1">1000</span>:]
<span class="pl-s1">y_test</span> <span class="pl-c1">=</span> <span class="pl-s1">y</span>[<span class="pl-c1">1000</span>:]

<span class="pl-s1">gp</span> <span class="pl-c1">=</span> <span class="pl-s1">gaussian_process</span>.<span class="pl-v">GaussianProcess</span>()
<span class="pl-s1">gp</span>.<span class="pl-en">fit</span>(<span class="pl-v">X_train</span>, <span class="pl-s1">y_train</span>)

<span class="pl-s1">gp</span>.<span class="pl-en">predict</span>(<span class="pl-v">X_test</span>, <span class="pl-s1">batch_size</span><span class="pl-c1">=</span><span class="pl-c1">100</span>)</pre></div>
<h4 dir="auto">Expected Results</h4>
<p dir="auto">No error is thrown.</p>
<h4 dir="auto">Actual Results</h4>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
&lt;ipython-input-13-b96b929502ec&gt; in &lt;module&gt;()
----&gt; 1 gp.predict(X_test, batch_size=100)

/usr/local/lib/python3.5/site-packages/sklearn/gaussian_process/gaussian_process.py in predict(self, X, eval_MSE, batch_size)
    520
    521                 y = np.zeros(n_eval)
--&gt; 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"><pre class="notranslate"><code class="notranslate">---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
&lt;ipython-input-13-b96b929502ec&gt; in &lt;module&gt;()
----&gt; 1 gp.predict(X_test, batch_size=100)

/usr/local/lib/python3.5/site-packages/sklearn/gaussian_process/gaussian_process.py in predict(self, X, eval_MSE, batch_size)
    520
    521                 y = np.zeros(n_eval)
--&gt; 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
</code></pre></div>
<h4 dir="auto">Versions</h4>
<p dir="auto">scikit-learn (0.17.1)<br>
Python 3.5.2</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows-10-10.0.10586
Python 3.4.4 |Continuum Analytics, Inc.| (default, Jan 29 2016, 15:20:20) [MSC v.1600 64 bit (AMD64)]
NumPy 1.10.4
SciPy 0.17.0
Scikit-Learn 0.17.1"><pre class="notranslate"><code class="notranslate">Windows-10-10.0.10586
Python 3.4.4 |Continuum Analytics, Inc.| (default, Jan 29 2016, 15:20:20) [MSC v.1600 64 bit (AMD64)]
NumPy 1.10.4
SciPy 0.17.0
Scikit-Learn 0.17.1
</code></pre></div>
<p dir="auto">The following code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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)"><pre class="notranslate"><code class="notranslate">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)
</code></pre></div>
<p dir="auto">Results in the error</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="'float' object cannot be interpreted as an integer"><pre class="notranslate"><code class="notranslate">'float' object cannot be interpreted as an integer
</code></pre></div>
<p dir="auto">Because of:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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)
--&gt; 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"><pre class="notranslate"><code class="notranslate">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)
--&gt; 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
</code></pre></div>