Glossary · Machine Learning
What is Train-Test Split?
Dividing data into a part for training a model and a held-out part for checking how it performs on unseen data.
In more detail
Often 80/20, stratified for classification. The test set should be used once, at the end; tuning uses cross-validation or a validation set.
Example
train_test_split(X, y, test_size=0.2, stratify=y)
Learn it properlyHow Machine Learning Works: Data, Features, Training and Prediction10 min lesson · Machine Learning