Ten noisy points from a parabola. Raise the polynomial degree and watch the error on unseen data fall, explode at the point where the curve can pass through every point, then fall again once there are more coefficients than points.
How it works. Polynomials are written in the Legendre basis on [−1, 1] so that degree 25 stays numerically stable; a degree-d polynomial has d + 1 coefficients. Up to degree 8 there are fewer coefficients than points, so the fit is ordinary least squares. Degree 9 has exactly 10 coefficients: one polynomial passes through all 10 points. From degree 10 on, infinitely many polynomials pass through all points. We draw 100 of them (one interpolant plus random directions that leave the training points untouched) and keep the best by the chosen rule. Test error is the mean squared distance from y = 2.2x⁴ + 0.35x³ − 1.8x² + 0.4 over the data range. Based on the idea in this short.