Exclude data recorded after prediction time

A feature must be available when the prediction is made.

A feature must be available when the prediction is made. Transfer duration is the target. Putting the measured duration into the feature set leaks the answer.

Work through the example

If a prediction simply copies its target, absolute training error is |y - y| = 0. That input is unavailable before a new transfer finishes.

Run the example as a separate Python file. The inputs are synthetic so you can change them and see exactly which assumption affects the result.

Run the example

targets = [2,4]
leaked_predictions = targets[:]
print([abs(p-y) for p,y in zip(leaked_predictions,targets)])

Expected output

[0, 0]

Reference: https://developers.google.com/machine-learning/glossary#feature

The team guide · My original notes on testing coding agents · Working with Lightbulb Partners