Beta

Sync to cloud

Uses your current signed-in YoolVi account. A Learn profile is not required.

Upload a snapshot of this browser’s saved lesson work across all subjects, including notes, experiments, journal and review history. Existing guest work is included only when you confirm below. This does not upload account credentials or award XP.

Sync uploads to your private account; it does not automatically merge or replace this device’s work. On another device, download the cloud copy and use My Learning’s backup import. The previous cloud snapshot is retained when a new one replaces it.

Export or import this device’s work

No background uploads. Edits made after a snapshot need another sync. On shared devices, work is bound to the first account observed by cloud sync; another account must use a separate browser profile. Keep your own downloaded backup too.

Learning preferences

Make learning more comfortable. Changes apply immediately.

Enlarges page content, including diagrams and their labels. You can also use your browser’s zoom.

Choose the colours that are easiest for you to distinguish. Applies to lesson diagrams and lab plots. Labels, shapes, hatching and line patterns also distinguish meanings. Source photographs and raw image brightness stay unchanged; mask-only views are available for image overlays.

ExampleComparisonSample link

Saved in this browser on this device. Preferences are separate from progress backups.

Back to Classical Machine Learning

Classical Machine Learning · Lesson 1 of 3 in this module

Understand training versus checking

Training versus checkingFixed teaching example — not your saved experiment.
  1. Starting information

    Model A fits every training point

  2. Relationship or operation

    Check different examples from the task

  3. Consequence

    Some new predictions can still fail

Overfitting means adapting to training details that do not help on other cases. Training fit alone cannot select the best model.

The idea in everyday terms

A model can fit familiar examples very closely and still predict new ones poorly. Training examples are used to adjust its parameters. Validation examples help choose settings, such as how flexible the curve should be. A final test checks the chosen model after those decisions are fixed.

What to watch in the experiment

Compare both error curves as you change complexity. A more flexible curve may follow noise in the training points. Lower training error alone cannot tell you whether that extra detail helps elsewhere. Freeze your choice before revealing the test result.

What this does not establish

This is a small synthetic experiment. Looking at the test and then tuning again makes it familiar development evidence; resetting the model cannot make that evidence unseen.

Full worked explanation, calculations and control definitions

Use this reference for the detailed mechanism and control meanings. Derivations explicitly marked optional are enrichment.

Three datasets, three jobs

Training data fits the parameters. Validation data helps you choose settings such as model size or regularization. Test data estimates the final chosen model’s performance after those choices are frozen. Reusing the test score to make choices turns it into another validation score.

The lab uses 12 training points, 24 validation points, and 24 separately generated test points. All come from the same smooth toy relationship with independent noise. Circles are training observations; diamonds are validation observations. The curve is fitted only to the circles. The final test observations remain hidden until you freeze your choice.

A split must match the real task. If two almost identical photos of the same object land in different sets, the test may be too easy. For predicting the future, a time-based split can be more appropriate than shuffling everything. No split repairs unrepresentative or incorrectly labeled data by itself.

The most flexible curve is not always the best predictor

A polynomial adds powers of the input. Degree 1 is a straight line; a higher degree can bend more. In this lab, degree 11 has enough flexibility to pass through all 12 training points. Some of those points contain random noise, so a perfect fit can make the curve worse between them. This is overfitting. A model too restricted to capture the useful pattern underfits.

Compare degrees 1, 4, and 11. Training error falls as flexibility increases, but validation error does not keep falling. The comparison table reports actual measured errors from the fits; it is not an invented performance curve. Here, fitting solves a small least-squares system directly rather than running the gradient-descent animation from the previous module.

mean squared error=1n∑i=1n(y^i−yi)2\text{mean squared error}=\frac{1}{n}\sum_{i=1}^{n}(\hat y_i-y_i)^2

Every learning process has preferences

An inductive bias is a preference among explanations that could fit the observations. Model architecture, initialization, optimizer, regularization, and data all shape that preference. A model looking at neighboring pixels favors different patterns from one comparing words across a sentence.

Regularization adds a cost for certain parameter choices. Our lab penalizes the squared nonconstant polynomial coefficients. The fit therefore trades training error against that penalty. The displayed losses remain ordinary mean squared errors, without adding the penalty. This particular penalty depends on the numerical basis used to express the polynomial; it is one teaching choice, not a universal measure of simplicity.

More parameters do not automatically imply worse generalization. Modern networks can generalize even when they have enough parameters to memorize their data. Parameter count alone does not describe the solution actually found.

A good test has a boundary

Even an independent test only samples the conditions it contains. A model trained on bright photographs may fail in dim light. This is distribution shift: the conditions change. Test meaningful variations and report failures alongside successes.

Our frozen test is a small estimate, not proof of real-world reliability. If you reopen tuning after seeing it, it is no longer an unseen test. The lab keeps that warning even after a reset. In a real project, reserve new independent evidence for the next final claim.