2020年12月19日星期六

scipy curve fitting output is bounded between 0 and 1

I am trying to fit this data into the following function but the y-axis curve after plotting is between 0 and 1.Any help is appreciated.

def weib_cdf(data,a,k):      return (1-np.exp(-((data/a)**k)))  
# fit curve  popt, _ = curve_fit(weib_cdf,data['search_spends'], data['sales'])  plt.plot(data['search_spends'], weib_cdf(data['search_spends'], *popt), 'g--',label='fit: a=%5.3f, k=%5.3f' % tuple(popt))  plt.xlabel('Search spends')  plt.ylabel('Sales')  plt.legend()  plt.show()  

enter image description here

https://stackoverflow.com/questions/65376981/scipy-curve-fitting-output-is-bounded-between-0-and-1 December 20, 2020 at 12:43PM

没有评论:

发表评论