Question 1 of 5

Why do we need train, validation and test sets?

You compared two model variants and kept the one that performed better on checking examples. Can those examples still provide an independent final check?

Suppose you have a collection of labelled reviews. You train on one part, then use another part to compare versions and pick a winner. Those comparison reviews have now influenced your choice. To estimate how the winner will do on the next batch, keep a separate set of reviews untouched until the end.

WHERE TO START

Which examples would you reserve for the model to see for the first 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