问题
I curious about how to get "first-order optimality" value using python script. For optimatization python has many module like scipy.optimize and openopt. But I confused how to use that module to get first-order optimality
This is sample matlab script to get first-order optimality
[x,resnorm,residual,exitflag,output,lambda]= lsqcurvefit(func,x0,xdata,tdata);
foo = output.firstorderopt %get first-order optimality value
this is some of foo reference from mathworks here
Thanks for your attention, Happy New Year 2011 :)
回答1:
Try scipy.linalg.basic.lstsq or scipy.optimize.minpack.curve_fit
Try to write your own code, refer to the tutorials or else search the web for scipy.linalg.basic.lstsq
for code samples (there are some out there). If you encounter any issues, post the code and the issue here.
来源:https://stackoverflow.com/questions/4573788/how-to-get-first-order-optimality-with-python-script