Reputation: 265
What is the correct way to call dual_annealing scipy optimizer?
Tried both the variants, neither of them works.
import scipy.optimize as spo
optimizer_fn = 'spo.dual_annealing'
optimizer = eval(optimizer_fn)
def func(params, y, penalty_list=None):
<more code here>
args = [df_1, df_2, df_3, df_4, df_5, name]
optimizer(func,
bounds=[(0, 1)] * len(df_values),
args=args,
options={"maxiter": budget})
TypeError: dual_annealing() got an unexpected keyword argument 'options'
args = [df_1, df_2, df_3, df_4, df_5, name]
optimizer(func,
bounds=[(0, 1)] * len(df_values),
args=args,
maxiter=budget)
TypeError: objective_function() takes from 2 to 3 positional arguments but 7 were given
Upvotes: 1
Views: 45