Training Data
Training data is the set of examples a machine learning model learns from. The model studies this data and adjusts its internal parameters to capture the patterns it contains.
Data & AI
The quality and quantity of training data hugely affect how well a model performs — 'garbage in, garbage out.' If the training data is biased or unrepresentative, the model will be too.
Training data is kept separate from test data. The model learns on the training set and is then evaluated on the test set, which it has never seen, to check whether it truly learned the pattern or just memorized examples.
Examples
Python
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, random_state=42)
print(len(X_train), len(X_test))Output:
80 20