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 }}
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.
If i run the Latin Hypercube sampling with the basic lines of code:
from skopt.sampler import Lhs
from skopt.space import Space
space = Space([(1,2),(3,4)])
lhs = Lhs(criterion="maximin", iterations=10000)
initial_population = lhs.generate(space.dimensions, 5)
I run into the error
Traceback (most recent call last):
File "", line 1, in
File "/Users/malmansto/anaconda3/envs/fem-cycle-model/lib/python3.10/site-packages/skopt/sampler/lhs.py", line 89, in generate
h_opt = space.inverse_transform(h_opt)
File "/Users/malmansto/anaconda3/envs/fem-cycle-model/lib/python3.10/site-packages/skopt/space/space.py", line 999, in inverse_transform
columns.append(dim.inverse_transform(Xt[:, start]))
File "/Users/malmansto/anaconda3/envs/fem-cycle-model/lib/python3.10/site-packages/skopt/space/space.py", line 528, in inverse_transform
inv_transform = super(Integer, self).inverse_transform(Xt)
File "/Users/malmansto/anaconda3/envs/fem-cycle-model/lib/python3.10/site-packages/skopt/space/space.py", line 168, in inverse_transform
return self.transformer.inverse_transform(Xt)
File "/Users/malmansto/anaconda3/envs/fem-cycle-model/lib/python3.10/site-packages/skopt/space/transformers.py", line 309, in inverse_transform
X = transformer.inverse_transform(X)
File "/Users/malmansto/anaconda3/envs/fem-cycle-model/lib/python3.10/site-packages/skopt/space/transformers.py", line 275, in inverse_transform
return np.round(X_orig).astype(np.int)
File "/Users/malmansto/anaconda3/envs/fem-cycle-model/lib/python3.10/site-packages/numpy/init.py", line 305, in getattr
# raise AttributeError(former_attrs[attr])
AttributeError: module 'numpy' has no attribute 'int'. np.int was a deprecated alias for the builtin int. To avoid this error in existing code, use int by itself. Doing this will not modify any behavior and is safe. When replacing np.int, you may wish to use e.g. np.int64 or np.int32 to specify the precision. If you wish to review your current use, check the release note link for additional information.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'inf'?
This is fixed when commenting out 197 - 321 in the init.py file. Maybe you can fix that
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If i run the Latin Hypercube sampling with the basic lines of code:
I run into the error
Traceback (most recent call last):
File "", line 1, in
File "/Users/malmansto/anaconda3/envs/fem-cycle-model/lib/python3.10/site-packages/skopt/sampler/lhs.py", line 89, in generate
h_opt = space.inverse_transform(h_opt)
File "/Users/malmansto/anaconda3/envs/fem-cycle-model/lib/python3.10/site-packages/skopt/space/space.py", line 999, in inverse_transform
columns.append(dim.inverse_transform(Xt[:, start]))
File "/Users/malmansto/anaconda3/envs/fem-cycle-model/lib/python3.10/site-packages/skopt/space/space.py", line 528, in inverse_transform
inv_transform = super(Integer, self).inverse_transform(Xt)
File "/Users/malmansto/anaconda3/envs/fem-cycle-model/lib/python3.10/site-packages/skopt/space/space.py", line 168, in inverse_transform
return self.transformer.inverse_transform(Xt)
File "/Users/malmansto/anaconda3/envs/fem-cycle-model/lib/python3.10/site-packages/skopt/space/transformers.py", line 309, in inverse_transform
X = transformer.inverse_transform(X)
File "/Users/malmansto/anaconda3/envs/fem-cycle-model/lib/python3.10/site-packages/skopt/space/transformers.py", line 275, in inverse_transform
return np.round(X_orig).astype(np.int)
File "/Users/malmansto/anaconda3/envs/fem-cycle-model/lib/python3.10/site-packages/numpy/init.py", line 305, in getattr
# raise AttributeError(former_attrs[attr])
AttributeError: module 'numpy' has no attribute 'int'.
np.int
was a deprecated alias for the builtinint
. To avoid this error in existing code, useint
by itself. Doing this will not modify any behavior and is safe. When replacingnp.int
, you may wish to use e.g.np.int64
ornp.int32
to specify the precision. If you wish to review your current use, check the release note link for additional information.The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'inf'?
This is fixed when commenting out 197 - 321 in the init.py file. Maybe you can fix that
The text was updated successfully, but these errors were encountered: