4/20
Linear Regression from Scratch · Page 2 of 2

Visualizing the Training Process

Visualizing the Training Loop

Seeing the math is good, but seeing the line move is how you truly understand Gradient Descent.

Notice how the line starts completely wrong, but gradually pivots to fit the data perfectly as the MSE decreases.

Overfitting vs Underfitting

  • Underfitting: The line is too straight (high bias).
  • Overfitting: The line wiggles to hit every single point perfectly (high variance) — bad for new data.
  • Good Fit: Captures the general trend.
main.py
Loading...
OUTPUT
Click "Run Code" to execute…