SciPy - Curve Fitting and Regression
What will be the output of the following code snippet?
import numpy as np
from scipy.optimize import curve_fit
def model(x, a, b):
return a * np.exp(b * x)
xdata = np.array([0, 1, 2, 3])
ydata = np.array([1, 2.7, 7.4, 20.1])
params, _ = curve_fit(model, xdata, ydata)
print(np.round(params, 2))