Polynomial Regression › Visualizing Polynomial Regression
Machine Learning from ScratchAll chapters Polynomial Regression › Visualizing Polynomial RegressionOne section · Sections in this chapter3 / 8 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Let's explore how polynomial regression can capture different types of non-linear relationships through a visualization.




The visualization above shows how different polynomial degrees capture the underlying non-linear relationship. We can see that:
- Degree 1 (Linear): Captures only the general trend but misses the curvature
- Degree 2 (Quadratic): Begins to capture some curvature but still oversimplifies
- Degree 3 (Cubic): Closely matches the true cubic relationship
- Degree 5: Overfits the data, creating unnecessary complexity and wiggles
This illustrates the fundamental trade-off in polynomial regression: higher degrees can capture more complex relationships but risk overfitting to noise in the data.
This demonstrates the classic bias-variance trade-off in machine learning. Lower-degree polynomials have high bias (underfitting) but low variance, while higher-degree polynomials have low bias but high variance (overfitting). The optimal degree typically lies somewhere in between, where the model captures the true underlying pattern without fitting to noise.