Linear regression minimizes the sum of squared residuals. For points \((x_i, y_i)\), we solve for \(w\) and \(b\) in \(\hat{y} = wx + b\):
\[ w = \frac{n\sum x_i y_i - \sum x_i \sum y_i}{n\sum x_i^2 - (\sum x_i)^2}, \quad b = \bar{y} - w\bar{x} \]
Click to add points — the regression line appears after 2 points.
Weight (w)
0
Bias (b)
0
MSE
0
Points
0
How to Use This Tool
- Add at least two points to see the regression line appear.
- Try outliers — notice how MSE increases and the line shifts.
- Use "Load Sample Data" for a noisy linear trend.
- Compare your intuition with the formulas in ML Beginner.