Fit sigmoid function (“S” shape curve) to data using Python
问题 I'm trying to fit a sigmoid function to some data I have but I keep getting: ValueError: Unable to determine number of fit parameters. My data looks like this: My code is: from scipy.optimize import curve_fit def sigmoid(x): return (1/(1+np.exp(-x))) popt, pcov = curve_fit(sigmoid, xdata, ydata, method='dogbox') Then I get: --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-5-78540a3a23df> in <module> 2