SciPy - Curve Fitting and Regression
Given the code below, what will be the output of
popt?
import numpy as np
from scipy.optimize import curve_fit
def linear(x, a, b):
return a * x + b
xdata = np.array([1, 2, 3, 4, 5])
ydata = np.array([2.1, 4.1, 6.1, 8.1, 10.1])
popt, pcov = curve_fit(linear, xdata, ydata)
print(popt)