Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Front-end does not support purely categorical factors #210

Open
dk-teknologisk-mon opened this issue Nov 30, 2022 · 0 comments
Open

Front-end does not support purely categorical factors #210

dk-teknologisk-mon opened this issue Nov 30, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@dk-teknologisk-mon
Copy link

Describe the bug
If you create an experiment where you only add categorical choices, you get an error when you try to run the experiment. I'm pretty sure this is simply caused by the fact that you cannot use base_estimator="GP" in the call of Optimizer in the back-end with purely categorical factors. Instead, you need to call Optimizer with base_estimator="RF".

To Reproduce
Steps to reproduce the behavior:

  1. I have attached a .json from the front-end with the setup that produced the error in the first place. Github won't accept the .json format, so I converted it to a .txt file instead Example categorial DOE.txt

  2. I can also force an error in the back-end like so:
    If I define this parameter space: space = [["A", "B"],["C", "D", "E"],["F", "G"]] and then try to build an Optimizer in the pure back-end with this call: opt = Optimizer(space,base_estimator="GP",acq_func="EI",n_initial_points=5,), then I get the following error:

Traceback (most recent call last):
  File "C:\Users\mon\AppData\Local\Temp/ipykernel_4320/2372620011.py", line 1, in <cell line: 1>
    opt = Optimizer(space,base_estimator="GP",acq_func="EI",n_initial_points=5,)
  File "c:\users\mon\documents\processoptimizer\ProcessOptimizer\optimizer\optimizer.py", line 294, in __init__
    raise ValueError(
ValueError: GaussianProcessRegressor on a purely categorical space is not supported. Please use another base estimator

If you change base_estimator to "RF", everything works as expected.

Expected behavior
The front-end should support this type of setup and work in the same manner as for all other experiments. The simple fix is to check whether all factors are categorical, and if true, then change base_estimator from "GP" to "RF".

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Chrome
  • Version: BB version 1.6.2
@dk-teknologisk-mon dk-teknologisk-mon added the bug Something isn't working label Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant