How to get “first-order optimality” with python script

社会主义新天地 提交于 2019-12-24 18:56:36

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!