ML Foundations · Lesson 6

Generalisation

Generalisation is a machine-learning foundation.

ConceptWorked examplePracticeKnowledge check
Textbook walkthrough

What Generalisation actually means

Generalisation is a machine-learning foundation. A learning algorithm uses examples to estimate model parameters; the goal is not to memorise the training set but to generalise to new observations drawn from the intended deployment process.

Generalisation matters because machine learning is a procedure for generalising from examples, not merely fitting an algorithm. Features, targets, parameters, hyperparameters and validation each play different roles in that procedure.

Deeper walkthrough

Read Generalisation as a mechanism, not a recipe

Treat this as a sequence of observable decisions rather than one opaque command. Stage 1: Define each example, feature vector and target (if supervised). Stage 2: Choose a model family with parameters learned from training data. Stage 3: Choose hyperparameters through a validation process rather than from test performance. Final checkpoint: Use the frozen fitted pipeline for inference on new data.

Mechanism

Follow the transformation

Define each example, feature vector and target (if supervised).

Choose a model family with parameters learned from training data.

Choose hyperparameters through a validation process rather than from test performance.

Evidence

Know what would convince you

  • Fit a tiny or baseline case first and confirm prediction shape/range and a few outputs.
  • Evaluate with the same held-out folds/metric as competing models and inspect variability, not just the mean.
Useful distinctionFeature X: Input information available to the model.
How it works

Trace the mechanism step by step

  1. Define each example, feature vector and target (if supervised).
  2. Choose a model family with parameters learned from training data.
  3. Choose hyperparameters through a validation process rather than from test performance.
  4. Fit on training data and evaluate on independent validation/test data.
  5. Use the frozen fitted pipeline for inference on new data.
Worked demonstration

Make the concept concrete

Demonstration

Text example

Training accuracy = 99%, validation accuracy = 72% → likely overfitting/generalisation gap.
Training accuracy = 73%, validation = 72% → model is stable but may underfit.
Expected / illustrative result
Generalisation is performance on new data from the intended deployment distribution, not performance on examples the model already saw.
Interpret the result.

For Generalisation, connect the reported result to the exact training/validation/prediction step that produced it and check one prediction, fold or metric component independently.

Distinctions & related ideas

Know what this is — and what it is not

Feature XInput information available to the model.
Target yOutcome to predict in supervised learning.
ParameterLearned during fitting, e.g. regression coefficients.
HyperparameterSet outside the fitting step, e.g. tree depth.
InferenceApplying a fitted model to new examples.
Use deliberately

When it is appropriate

Use Generalisation when its inductive assumptions fit the feature/target structure and it can be compared fairly with a simpler baseline on unseen data.

Boundary conditions

When to stop or reconsider

Prefer a simpler or different model when the sample size, representation, computational budget, interpretability requirement or data geometry conflicts with this method.

Common mistakes

Failure modes to recognise

  • Judging the model only by training fit instead of generalisation on held-out data.
  • Comparing models with inconsistent preprocessing, folds or evaluation metrics.
  • Tuning complexity without checking a simple baseline, error patterns and variance across splits.
Verification

How to check the result

  • Fit a tiny or baseline case first and confirm prediction shape/range and a few outputs.
  • Evaluate with the same held-out folds/metric as competing models and inspect variability, not just the mean.
  • Inspect errors/residuals or decision boundaries and vary one key hyperparameter to verify expected behaviour.
Hands-on practice

Demonstrate understanding

Try this:

Build a tiny, inspectable example of Generalisation. First define each example, feature vector and target (if supervised). Then choose a model family with parameters learned from training data. Write the expected result before running it, and explain one condition that would make the result misleading or invalid.

Start with a small baseline and a fixed validation split/fold assignment. Predict what increasing or decreasing one complexity control should do before testing it.
Knowledge check

Check reasoning, not memorisation

Before trusting a result from Generalisation, which check provides the strongest evidence that you understand and applied it correctly?

Quick reference

Keep the important distinctions visible

Step 1Define each example, feature vector and target (if supervised).
Step 2Choose a model family with parameters learned from training data.
Step 3Choose hyperparameters through a validation process rather than from test performance.
Step 4Fit on training data and evaluate on independent validation/test data.
Lesson summary

What to remember

  • Generalisation is a machine-learning foundation. A learning algorithm uses examples to estimate model parameters; the goal is not to memorise the training set but to generalise to new observations drawn from the intended deployment process.
  • Define each example, feature vector and target (if supervised).
  • Judging the model only by training fit instead of generalisation on held-out data.
  • Fit a tiny or baseline case first and confirm prediction shape/range and a few outputs.