x = np.array([1, 3, 5, 7, 9])
y = np.array([ 6, 3, 9, 5 , 4])
m , b = np.polyfit(x, y, 1)
how does the 1(deg) work in this linear regression? I do know it represents the degree of fitting the polynomial but how does it actually work.
The degree-parameter n determines the polynimial equation used for fitting. The coefficients p in this formula are in descending powers, and the length of p is n+1
This formula is then fitted (in a least-squares sense) to the data.