Week 13 · lesson

Training, Decision Boundaries, and Held-Out Data

Training is the process of choosing model parameters from examples. In a modern neural network there may be millions or billions of parameters. In our tiny experiment there is only one: a distance threshold.

Suppose we begin with this rule:

if distance <= threshold:
    predict stop
else:
    predict continue

The structure of the rule was chosen by us. Training chooses a value for threshold that performs well on the training examples.

A decision boundary separates predictions

If the nearest continue example is 44 cm and a stop example appears at 18 cm, a simple candidate boundary is halfway between them:

(18 + 44) / 2 = 31 cm

So one candidate model is:

31 cm or nearer  -> stop
farther than 31  -> continue

That is already a model. It receives an input and produces a prediction according to fitted parameters.

Now add two more examples:

DistanceLabel
29 cmcontinue
34 cmstop

No single threshold can classify every row correctly. Training now becomes an optimization problem: choose a boundary that makes the error small according to a defined objective.

Real learning algorithms do the same thing at a larger scale. They search parameter values that reduce a loss or improve some training objective. The mathematics may be more complicated, but the evidence question is unchanged: what data shaped those parameters?

Why we hold data back

If we judge the model only on the same rows used to choose the threshold, we are partly grading the model on material it already studied.

A basic experiment therefore separates data into roles:

  • training data influences the fitted parameters;
  • validation data may help us make design choices;
  • test data is held back for a final evaluation.

The names vary by project, but the principle is stable: evaluation evidence is stronger when it did not participate in fitting the model being judged.

Training performance is not deployment performance

A threshold can perform perfectly on five training rows and fail on the sixth real-world case. The model has no way to promise that future data will look like the data used to fit it.

That is why a serious claim sounds like this:

On this held-out test set, using this threshold and these features, the model classified 9 of 10 examples correctly.

Not this:

The model is 90% correct.

The first sentence identifies the evidence boundary. The second quietly turns one experiment into a universal claim.

Before moving on

Explain why changing the threshold after looking at the final test errors weakens the claim that the test set was truly held out.