📜  python代码示例中的拟合函数

📅  最后修改于: 2022-03-11 14:45:21.052000             🧑  作者: Mango

代码示例1
from scipy import optimize
def f(x,a,b): return x*a+b
popt, pcov = optimize.curve_fit(f, xdata, ydata)
#popt contains the fitted parameters and pcov is the covariance matrix
#with variances on the diagonal