This is a short question, but google points me every time to the documentation where I can't find the answer.
I am using scipy.optimize.minimize. It works pretty good, all things are fine. I can define a method to use, but it works even if I don't specify the method.
Is there any way to get an output, which method was used? I know the result class, but the method isn't mentioned there.
Here's an example:
solution = opt.minimize(functitionTOminimize,initialGuess, \
constraints=cons,options={'disp':True,'verbose':2})
print(solution)
I could set the value method to something like slsqp
or cobyla
, but I want to see what the program is choosing. How can I get this information?
According to the scipy.optimize.minimize() docs: If no method is specified the default choice will be one of BFGS, L-BFGS-B, SLSQP.
To get more details on how the method is chosen, you should take a look at the line 480 of minimize(). The method is chosen like this:
if method is None:
# Select automatically
if constraints:
method = 'SLSQP'
elif bounds is not None:
method = 'L-BFGS-B'
else:
method = 'BFGS'