A polynomial curve is fitted, live in your browser, to a noisy scatter of data points on the "Data & Fit" board. Behind the scenes it uses ordinary least-squares regression solved with Gaussian elimination — the same core idea behind fitting far more complex models. To the right, a bar chart plots training error against held-out validation error for every complexity level, and below sits a spinning k-fold cross-validation wheel showing which slice of data is currently held out for testing.
k-fold cross-validation (commonly k=5 or k=10) is preferred over a single train/test split because every data point gets to be validated exactly once, giving a much more stable estimate of how a model will perform on truly unseen data.
A polynomial model fits a noisy 3D scatter plot in real time while a spinning k-fold cross-validation wheel and a live train/validation error chart reveal the bias-variance tradeoff as it happens.
Raising model complexity always shrinks training error, but validation error follows a U-shape — improving, then rising again as the model starts memorizing noise instead of the underlying pattern.
Slide model complexity to watch the fitted curve underfit, fit well, or overfit. Change the number of folds and the held-out fold to see k-fold cross-validation in action, or let it auto-cycle through every fold.
Because every point is validated exactly once across a full k-fold pass, cross-validation gives a far more reliable estimate of real-world performance than judging a model on a single lucky (or unlucky) train/test split.