Tested tool guide
Tested browser tools
Checked August 16, 2026
What Least Squares Regression Visualizer does, with a checked example
Enter paired x and y observations and select a straight-line or polynomial model. The visualizer finds coefficients that minimize the sum of squared vertical residuals, then shows the fitted curve, residuals, R-squared, and the corresponding normal equation. The most common surprise is that increasing the polynomial degree can improve the in-sample R-squared without producing a more useful model. A close fit may reflect overfitting, especially when there are few points.
Worked example
A concrete input and expected output from the current implementation.
Input
Model: linear
0, 1
1, 3
2, 5
->
Expected output
Best-fit line: y = 1 + 2x
Residuals: [0, 0, 0]
R-squared: 1
Normal equation: [[3, 3], [3, 5]] [c0, c1]^T = [9, 13]^T
All three points lie exactly on y = 1 + 2x, so every residual and the residual sum of squares are zero. Since the y-values have nonzero variation, R-squared is 1 - 0/8 = 1.