BoostV / BoostV/process-optimizer-frontend

Front-end does not support purely categorical factors

Open
#210 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
10
Forks
3
PR merge metrics
No merged PRs in 30d

Description

**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](https://github.com/BoostV/process-optimizer-frontend/files/10120759/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
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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.