Regression PlaygroundLEAST SQUARES
Polynomial curve fitting, residual error computation (SS_res), and test-train variance inspection via exact analytical least squares.
+
+
+
+
03 // Cartesian Regression Stage
CLICK CANVAS TO INJECT SAMPLES
ŷ = 0.829x + 13.890(Degree 1)
Target Domain: [0, 100] × [0, 100]
TRAIN (27)
TEST (8)
FITTED MODEL
RESIDUAL (y − ŷ)
01 // Polynomial Model Spec
POLYNOMIAL DEGREE (d)1 // LINEAR
UNDERLYING SYNTHETIC FUNCTION
GAUSSIAN NOISE (σ)6
SAMPLE DENSITY (N)35
TRAIN / TEST SPLIT (75% / 25%)
02 // Residual Telemetry & Gauges
Analytical Least SquaresTRAIN27 PTS
MSE:41.1055
MAE:5.1951
R²:0.9186
TEST8 PTS
MSE:30.1183
MAE:4.089
R²:0.9534
Strong Generalization: Degree 1 fits the underlying structure well, maintaining consistent test R² (95.3%) close to training R² (91.9%).
04 // Statistical Rigor: Zero-Variance Target Behavior
R² = 1 − (SS_res / SS_tot). If all target values are identical, total variance SS_tot = ∑(y_i − ȳ)² = 0.
In this degenerate edge case, dividing by zero renders R² mathematically undefined. ThinkViz explicitly reports N/A rather than silently outputting misleading finite numbers.
