Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

type Categorical crashes if domain starts with anything bigger than 0 #139

Open
p-sodmann opened this issue Dec 22, 2017 · 9 comments
Open

Comments

@p-sodmann
Copy link

I am currently running an optimization that needs about 2 hours per run and has a lot of dimensions.
To reduce the time spent i started to decrease the parameter space.

this works fine:

{'name': 'windowSelector', 'type': 'categorical', 'domain': np.arange(0,10)}   

while this causes an error:

{'name': 'windowSelector', 'type': 'categorical', 'domain': np.arange(1,10)}

Traceback (most recent call last):
File "optimizer.py", line 159, in
x_next = myBopt.suggest_next_locations(pending_X = pending)
File "/home/ps114900/anaconda3/lib/python3.6/site-packages/GPyOpt/core/bo.py", line 62, in suggest_next_locations
self._update_model(self.normalization_type)
File "/home/ps114900/anaconda3/lib/python3.6/site-packages/GPyOpt/core/bo.py", line 235, in _update_model
X_inmodel = self.space.unzip_inputs(self.X)
File "/home/ps114900/anaconda3/lib/python3.6/site-packages/GPyOpt/core/task/space.py", line 217, in unzip_inputs
Z.append(self.objective_to_model(X[k,:][None,:]))
File "/home/ps114900/anaconda3/lib/python3.6/site-packages/GPyOpt/core/task/space.py", line 206, in objective_to_model
new_entry = variable.objective_to_model(x_objective[0,k])
File "/home/ps114900/anaconda3/lib/python3.6/site-packages/GPyOpt/core/task/variables.py", line 152, in objective_to_model
entry[int(x_objective)] = 1
IndexError: list assignment index out of range

@javiergonzalezh
Copy link
Member

javiergonzalezh commented Dec 22, 2017 via email

@p-sodmann
Copy link
Author

can i use a constraint to ignore index 0?
It turned out, that the value 0 window form always produces bad results.

@javiergonzalezh
Copy link
Member

The index that you use should matter as soon as you update the objective function accordingly The index always need to start in zero, but that category may correspond to anything in the objective. If you have a small example we can try to help.

1 similar comment
@javiergonzalezh
Copy link
Member

The index that you use should matter as soon as you update the objective function accordingly The index always need to start in zero, but that category may correspond to anything in the objective. If you have a small example we can try to help.

@ekalosak
Copy link
Contributor

ekalosak commented Nov 7, 2019

This was closed, but was it fixed? Any tips on how to avoid this issue? I've seen it come up on some pet projects lately.

@Animadversio
Copy link

I encounter the same problem in version '1.2.6' so I think it hasn't got fixed yet

@apaleyes
Copy link
Collaborator

This was never addressed. At the moment categorial variables still have to be passed by index. Unfortunately the best answer I have right now is that if someone is bothered enough to create a PR to fix it, we'll happily merge it in.

At the very least let's reopen this. I think it was closed because it is behavior by design. Very poor design, admittedly.

@apaleyes apaleyes reopened this Jul 17, 2020
@yenicelik
Copy link

Still same issue

@ekalosak
Copy link
Contributor

@yenicelik GPyOpt has been EOL'd, I'd recommend the emukit project by some of the same authors.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants