Question 3 of 5

What is data leakage during feature preparation?

The model never trained on test examples, but the normalization mean was calculated from all data. Evaluation can become biased before the first training step.

Your app must predict a late delivery when an order is placed. In the historical table, the order already has its actual delivery time. Using that field makes the answer easy to recover in a test, but the field is still empty at checkout. Read each column as it would look at the moment of prediction.

WHERE TO START

Which fields are already known at prediction time?

What to know before this question
Topic example · Overlap between two sets

Change 12 on the second line to 14 and check the result.

train = {11, 12}
test = {12, 13}
print(sorted(train & test))
Line notes
  1. These ticket numbers belong to the training set.
  2. Store the ticket numbers reserved for testing.
  3. Print the ticket numbers that appear in both sets.

How would you rate your understanding?

This is your self-assessment. Progress is saved in this browser.

Not rated yet

← Back to Data and honest evaluation