Keep a test set independent
Use your thumb for spaces and keep your eyes on the next word. · 137 words
A test set contains examples saved for a final check of model performance. Suppose a collection includes several copies of one letter. If copies appear in training and testing, memorizing that letter can inflate the test score. Group copies together before dividing the collection so the test measures responses to fresh material.
Consider a collection of customer messages in which each complaint has several replies. Even when no reply is an exact copy, messages from the same thread may share a tracking number or a distinctive phrase. A model might recognize the thread instead of learning the intended distinction. Split by whole thread if deployment will involve new threads. If the task is predicting future complaints, a split by date may also matter. Choose the partition to match the kind of unfamiliar example the system will face.
Check your recall
Why group copies before splitting the data?
Check your answer
A copied letter in both groups lets memorization influence the final test.
Sources and credits
Original KeyTouch lesson. Background reading · UC Berkeley · Introduction to Artificial Intelligence.