How to specify target variable for bayes_opt

Viewed 14

I have a funktion that I want to maximize with bayes_opt. However, the function should not only return the target variable but also some other statistics:

def some_func(x,y)
    target_var = f(x,y)
    other_output = some statistics of x,y
    return target_var, other_output

optimizer = BayesianOptimization(f=some_func,
                                 pbounds=pbounds,
                                 )

How do I tell the optimizer to maximize the target_var? So I want somethink like:

optimizer.maximize(target_var, init_points=10, n_iter=20)

Thanks!

0 Answers
Related