Fit a curve and inspect what it misses
Choose different X and Y columns, set a degree from 1 to 6, and calculate. The curve, equation, fitted predictions and residual chart describe a least-squares model fitted with @kanaries/ml. The residual is observed minus predicted Y. At least ten rows are required for the separate holdout comparison.
Use validation to compare degree
Training error often falls as polynomial degree increases. Holdout error measures how a separate fitted model performs on excluded rows. Compare degrees on the same data and split, then favor a simpler model when performance is similar. A constant target has undefined R²; the tool reports that explicitly.
Reproduce the full transformation
The calculation centers and scales X before generating polynomial powers. JavaScript expands those features and uses Linear.LinearRegression; Python combines StandardScaler, PolynomialFeatures and LinearRegression. The code panel includes current data and reproduces the holdout split. Keep full-precision code for reproduction rather than copying the rounded display equation.
Work through a practical example
How to Choose a Polynomial Degree Without Overfitting explains the input, assumptions and expected output. Continue with How Outliers Change a Regression Line to compare methods and interpret results.