Early stopping in polynomial regression

Using a deep learning technique to fight overfitting for a simple linear regression model.

Michael Larionov, PhD
The Startup

--

Photo by CALIN STAN on Unsplash

I was testing an example from scikit-learn site, that demonstrates the problems of underfitting and overfitting and how we can use linear regression with polynomial features to approximate nonlinear functions, according to the article. Below is a modified version of this code.

Degree:  1  Coefficients:  [-1.60931179]
Degree: 4 Coefficients: [ 0.46754142 -17.78954475 23.5926603 -7.26289872]
Degree: 15 Coefficients: [-2.98294669e+03 1.03899932e+05 -1.87417069e+06 2.03717225e+07
-1.44873987e+08 7.09318780e+08 -2.47066977e+09 6.24564048e+09
-1.15677067e+10 1.56895696e+10 -1.54006776e+10 1.06457788e+10
-4.91379977e+09 1.35920330e+09 -1.70381654e+08]

This code was meant to demonstrate, that the model underfits if we pick a polynomial…

--

--