MACHINE LEARNING • LESSON 4

Training Data

Training data is the portion of the dataset that a Machine Learning model uses to learn relationships between inputs and outcomes.

THE CORE IDEA

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.

01

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.

02

What Does the Model See?

In supervised learning, the model receives examples containing input features and their corresponding known labels.

FEATURES 1,500 sq ft

3 bedrooms
2 bathrooms
8 years old

KNOWN LABEL $420,000

Actual selling price

The model uses many examples like this to learn relationships between the features and the label.

03

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.

04

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.

05

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.

MEMORIZATION Remember the examples

Works mainly when the model sees the same examples again.

LEARNING Learn useful patterns

The learned patterns can be applied to new examples.

This is one reason why we keep separate validation and test data.

06

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:

TRAINING 80%
VALIDATION 10%
TEST 10%

But this is only an example, not a rule.

The appropriate split depends on the dataset size, problem, evaluation strategy, and other practical considerations.

07

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.

Quantity does not replace quality.

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.

08

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.

Example

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.

09

Training in Simple Terms

Training Examples

Features + known labels

Learning

Model adjusts itself to reduce prediction errors.

Trained Model

Ready to make predictions.

10

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.

11

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 answers: "What examples can the model learn from?"
Validation and test data help answer: "How well does that learning work on unseen data?"
KEY IDEA

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.

QUICK CHECK

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?

Answer

They are used by the model to learn relationships between the house features and the known house prices.

NEXT TOPIC

Validation Data

Training teaches the model. But during development, we also need a way to compare different choices without using the final test set.