CampusSpark
ORIGINAL CAMPUSSPARK GUIDE

Keep evaluation separate from training

IntermediateExplanation · worked example · practice

An evaluation set checks behavior on examples not used to fit the model.

  1. Choose a simple baseline.
  2. Keep the evaluation examples out of fitting and tuning.
  3. Report the metric, sample limitations and failure cases together.
A model that memorises training labels can perform poorly on unseen examples.

See the reasoning, step by step.

  1. Fictional dataset: choose training and test partitions before learning a scaling transformation.
  2. Fit the scaler only on training rows. Apply that fitted scaler to both partitions; fit the model using training data.
  3. Evaluate the held-out partition only after choices are fixed. Fitting preprocessing on all rows lets test information influence training.

A mistake worth catching

The trap: Normalising the entire dataset before splitting it.

A better approach: Learn preprocessing within the training workflow, using a pipeline and appropriate validation where relevant.

Check your reasoning

Which workflow avoids letting test rows determine a scaling transformation?

Your turn: use the idea.

A student chooses hyperparameters by repeatedly checking the final test score. What should change?

Try it yourself first. This is a self-review task, not automatic marking.

Compare with a model answer

Use a separate validation procedure for model choices. Reserve the final test set for an evaluation after those choices are fixed; disclose any prior reuse.

Check your own work

Go deeper with the right source.

Supporting references and further reading. The worked examples above are original CampusSpark teaching material.

scikit-learn: common pitfalls and data leakage

Official guidance on preprocessing, fitting and evaluation separation.

Lesson and answer rationale reviewed 27 October 2026. A practice answer is not an official exam score.
Explore AI learning

Learning support, not an official certificate, professional assessment or automatic grade. Use original provider requirements for your examination or application.

Private AI