Test Data
Test data is a portion of the dataset held back and never used during training, used to measure how well a model performs on new, unseen examples.
Data & AI
Evaluating a model on the same data it trained on is misleading — it might have simply memorized the answers. The test set acts like a final exam with new questions, giving an honest estimate of real-world performance.
A common split is 80% training and 20% testing. Many workflows also use a third 'validation' set to tune settings while keeping the test set truly untouched until the very end.
Examples
Python
from sklearn.metrics import accuracy_score
predictions = model.predict(X_test)
print(accuracy_score(y_test, predictions))Output:
0.92