I'm reading on a text book about linear regression, and when I thought I finally understood degrees of freedom, I found a statement that made me doubt what I know so far. Well it's in the context of a simple linear regression (1 input).
The orange, blue and green squares indicate the MSEs associated with the corresponding curves in the lefthand panel. A more restricted and hence smoother curve has fewer degrees of freedom than a wiggly curve—note that in Figure 2.9, linear regression is at the most restrictive end, with two degrees of freedom.
What degree of freedom they talking about in here? What I know is that: df(regression)=p with p is the number of features used. So for this case it must be 1. df(residuals)=n-(p+1). df(total)=n-1. n is the sample size. Any help on what that 2 might be? Here is the two panels of the figure 2.9.