I have been playing with minimize function and would like to make an simple loop that would optimize a function using different optimization methods. Unfortunately, I have not been able to implement a list of desired methods I would like to try into my minimize function.
The problem I am encountering is how do I add "" symbols when taking an item from a list when defining what method I want to use?
methods = ["Nelder-Mead", "Powell"]
for numb, type in enumerate(methods):
x0 = [10, 20]
res = minimize(calculate_loss, x0, method = methods[type])
print("x0 = " + str(res.x) + (" ") + str(res.success))
Thank you for all suggestions, have a nice day.