MACHINE LEARNING • LESSON 4

Putting the Data Split Together

We have now learned about training data, validation data, test data, and how a dataset can be split. Let's put everything together and see how the three parts work as one complete process.

THE COMPLETE IDEA

Learn → Improve → Final Check

Training data is used to learn patterns. Validation data is used during development to help us make decisions. Test data is kept separate and used at the end to evaluate the finished model.

01

Start With the Complete Dataset

Imagine that we want to build a machine learning model that predicts whether a customer will buy a product.

We have collected information about 10,000 customers.

ORIGINAL DATASET 10,000 Customer Records

Each record contains information that can help the model understand customer behavior.

We don't use all 10,000 records for training. We first separate the dataset into different portions.

02

Split the Dataset

For this example, let's use the simple 80 / 10 / 10 split we learned earlier.

TRAINING • 80% 8,000 customers

Used to teach the model.

VALIDATION • 10% 1,000 customers

Used during development.

TEST • 10% 1,000 customers

Kept aside for the final evaluation.

Now each part has a clear purpose.

03

Step 1 — Train the Model

We start with the training data.

The model looks at the 8,000 training examples and learns patterns that connect customer information with whether the customer purchased the product.

INPUT 8,000 Training Records
MODEL Learns Patterns

At this point, the model has learned from the training examples.

04

Step 2 — Check With Validation Data

Next, we use the validation data to see how the current model performs during development.

We can use the validation results to compare different models or settings and decide what should be improved.

MODEL Current Version
+
VALIDATION 1,000 Records
RESULT Make Improvements

For example, suppose Model A has 85% validation accuracy and Model B has 92%. We may choose Model B for further development.

05

Step 3 — Final Test

After we finish developing the model and making our decisions, we use the test data.

The 1,000 test records were kept separate from the development process.

FINAL MODEL Ready
TEST DATA 1,000 Records
FINAL RESULT Measure Performance

This gives us a final measurement of how the finished model performs on data that was kept separate.

06

One Complete Example

Let's put the entire customer-purchase example together.

8,000 CUSTOMERS Training

Model learns customer behavior patterns.

1,000 CUSTOMERS Validation

We compare and improve the model.

1,000 CUSTOMERS Test

We perform the final evaluation.

07

What Happens If the Model Performs Poorly?

Suppose the final test result is worse than expected.

We should not simply keep changing the model based on the test result again and again. That would turn the test set into part of the development process.

Don't repeatedly tune the model using the test data.

Model development should primarily use the training and validation process. The test set is intended for the final evaluation.

This is why keeping the test data separate is important.

08

The Whole Process in One Picture

ORIGINAL DATASET 10,000 Records
SPLIT Training / Validation / Test
TRAIN Learn Patterns
VALIDATE Compare & Improve
TEST Final Evaluation
KEY IDEA

Each Data Split Has One Main Job.

Training data teaches the model. Validation data helps us develop and choose the model. Test data is kept separate and used for the final evaluation.

QUICK CHECK

Remember the Three Questions

1. What does the model learn from? Training Data
2. What helps us make development decisions? Validation Data
3. What gives us the final evaluation? Test Data
LESSON 4 COMPLETE

You Now Understand the Data Split.

You know why datasets are split, what training, validation, and test data mean, how a simple split works, and how the three parts work together during machine learning.

NEXT LESSON

Lesson 5 — Features and Labels

Next, we will learn what features and labels are, how they represent the input and output of a machine learning problem, and how we prepare them for a model.