Training Data
Training data is the portion of the dataset that a Machine Learning model uses to learn relationships between inputs and outcomes.
Training data is the data from which the model learns.
In supervised learning, the training examples normally contain both the input features and their known labels.
What Is Training Data?
Suppose we want to build a model that predicts house prices.
We have thousands of historical house records. Each record contains information such as:
- House size.
- Number of bedrooms.
- Number of bathrooms.
- Age of the house.
- Actual selling price.
We select a portion of these examples and give them to the model for learning. This portion is the training data.
What Does the Model See?
In supervised learning, the model receives examples containing input features and their corresponding known labels.
3 bedrooms
2 bathrooms
8 years old
Actual selling price
The model uses many examples like this to learn relationships between the features and the label.
Training Means Finding Patterns
The model is not simply storing every house and its price as a lookup table.
Its goal is to find useful relationships in the training examples.
Larger houses often have higher prices.
Location may affect price.
The age of a house may affect its value.
These are simplified examples of relationships that could exist in the data. A real model may discover much more complicated patterns.
Training Data Contains Many Examples
One example is not enough for the model to learn a reliable relationship.
Instead, the model receives many training samples.
| Size | Bedrooms | Bathrooms | Age | Price |
|---|---|---|---|---|
| 1,000 | 2 | 1 | 15 | $300,000 |
| 1,500 | 3 | 2 | 8 | $420,000 |
| 2,000 | 4 | 3 | 5 | $550,000 |
| 2,500 | 4 | 3 | 3 | $680,000 |
Every row gives the model another example from which it can learn.
Training Does Not Mean Memorizing
This distinction is important.
A useful model should learn a relationship that can be applied to examples it has not seen before.
Works mainly when the model sees the same examples again.
The learned patterns can be applied to new examples.
This is one reason why we keep separate validation and test data.
How Much Data Goes Into Training?
There is no single percentage that is correct for every Machine Learning project.
A common starting point might be something like:
But this is only an example, not a rule.
The appropriate split depends on the dataset size, problem, evaluation strategy, and other practical considerations.
More Training Data Can Help
In many situations, giving a model more high-quality training examples can help it learn better patterns.
For example:
- 100 useful house examples may provide limited information.
- 100,000 representative house examples can provide much more information.
But simply increasing the number of samples is not enough.
If the training data is incorrect, biased, irrelevant, or poorly representative of the real problem, adding more of the same bad data does not solve the underlying problem.
Training Data Must Represent the Problem
Imagine building a model to predict whether an online customer will purchase a product.
If the training data contains only customers who purchased something, the model has not learned enough about customers who did not purchase.
If a model is expected to work on customers from many age groups but the training data contains only one age group, the training data may not represent the real prediction problem.
Good training data should provide useful examples of the situations the model is expected to handle.
Training in Simple Terms
Features + known labels
Model adjusts itself to reduce prediction errors.
Ready to make predictions.
A Simple Python Connection
Later, when we use scikit-learn, the training step will look conceptually like this:
model.fit(X_train, y_train)
Here:
- X_train contains the training features.
- y_train contains the corresponding training labels.
- fit() tells the model to learn from those examples.
We will write real Python code later. For now, the important thing is understanding what the training data represents.
What Training Data Is Not
Training data is not the final proof that your model works well.
The model has already used training examples while learning.
That is why we need separate data for validation and final testing.
Training Data Is Used to Learn
Training data contains examples from which the model learns relationships between inputs and outcomes. Good training data should be relevant, representative, and useful for the problem we are trying to solve.
What Is Training Data?
You have 10,000 labeled house records. You reserve 8,000 of them for training.
What is the purpose of those 8,000 samples?
They are used by the model to learn relationships between the house features and the known house prices.