8000 Fix numpy depreciation errors · scikit-optimize/scikit-optimize@863575f · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.

Commit 863575f

Browse files
xmatthiasglouppe
authored andcommitted
Fix numpy depreciation errors
1 parent 273db8f commit 863575f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

skopt/learning/gaussian_process/kernels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ def __call__(self, X, Y=None, eval_gradient=False):
378378

379379
if np.iterable(length_scale):
380380
if len(length_scale) > 1:
381-
length_scale = np.asarray(length_scale, dtype=np.float)
381+
length_scale = np.asarray(length_scale, dtype=float)
382382
else:
383383
length_scale = float(length_scale[0])
384384
else:

skopt/space/space.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,13 @@ class Real(Dimension):
244244
name : str or None
245245
Name associated with the dimension, e.g., "learning rate".
246246
247-
dtype : str or dtype, default=np.float
247+
dtype : str or dtype, default=np.float64
248248
float type which will be used in inverse_transform,
249249
can be float.
250250
251251
"""
252252
def __init__(self, low, high, prior="uniform", base=10, transform=None,
253-
name=None, dtype=np.float):
253+
name=None, dtype=float):
254254
if high <= low:
255255
raise ValueError("the lower bound {} has to be less than the"
256256
" upper bound {}".format(low, high))
@@ -273,8 +273,8 @@ def __init__(self, low, high, prior="uniform", base=10, transform=None,
273273
"or 'float64'"
274274
" got {}".format(self.dtype))
275275
elif isinstance(self.dtype, type) and self.dtype\
276-
not in [float, np.float, np.float16, np.float32, np.float64]:
277-
raise ValueError("dtype must be float, np.float"
276+
not in [float, np.float16, np.float32, np.float64]:
277+
raise ValueError("dtype must be float, np.float64"
278278
" got {}".format(self.dtype))
279279

280280
if transform is None:

skopt/space/transformers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ def __init__(self, base):
8989
self._base = base
9090

9191
def transform(self, X):
92-
return np.log10(np.asarray(X, dtype=np.float)) / np.log10(self._base)
92+
return np.log10(np.asarray(X, dtype=float)) / np.log10(self._base)
9393

9494
def inverse_transform(self, Xt):
95-
return self._base ** np.asarray(Xt, dtype=np.float)
95+
return self._base ** np.asarray(Xt, dtype=float)
9696

9797

9898
class CategoricalEncoder(Transformer):

0 commit comments

Comments
 (0)
0