In a polynomial regression process(gradient descent) try to find the global minima to optimize the cost function. We choose the degree of polynomial for which the variance as computed by
Sr(m)/(n-m-1)$\frac{Sr(m)}{n-m-1}$
is a minimum or when there is no significant decrease in its value as the degree of polynomial is increased. In the above formula,
Sr(m) = sum of the square of the residuals for the mth order polynomial
n= number of data points m=order of polynomial (so m+1 is the number of constants of the model)
- Sr(m) = sum of the square of the residuals for the mth order polynomial
- n= number of data points
- m=order of polynomial (so m+1 is the number of constants of the model)
Refer : https://autarkaw.org/2008/07/05/finding-the-optimum-polynomial-order-to-use-for-regression/