尝试拟合S形增长曲线,为什么会报TypeError?

def func1(x,K,a,r):

    m = r*x
    return K/(1+a * math.exp(m))

popt1,_ = curve_fit(func1,x,y)

Python

讨论数量: 1

部分解决,换了numpy的exp方法,但又溢出了 D:\sumo\model.py:25: RuntimeWarning: overflow encountered in exp return K/(1+a * np.exp(m)) D:\sumo\model.py:28: OptimizeWarning: Covariance of the parameters could not be estimated popt1,_ = curve_fit(func1,x,y)

1天前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!