I recommend that you create a 1D_Polynomial folder and save this notebook in that folder.
The dataset is generated within the notebook.
An ordinary least squares (OLS) fit is used. Note that the original feature (x) is transformed to create features which are monomials (powers of x). These polynomial features add less value as their degree increases. Regression metrics are used to show this.
One of the signbs of overfitting is when successive beta coefficients become large and oscillate in sign. Therefore, note the plot that shows the range (i.e., max - min) of beta as the degree increases.
Consequently, a regularised linear regression is performed as well.
Students are invited to compare the two approaches, and to note the advantages and disadvantages of each.