MACHINE LEARNING • LESSON 1 • REVIEW

What Happens When Data Changes?

In the previous exercise, we changed the training data and saw that the prediction could change. Now let's understand why.

If the data changes, should the model stay exactly the same?

Usually not. A Machine Learning model learns from data, so changing important training examples can change what the model learns.

Start With Our Original Data

Our simple example started with these training examples:

SIZE PRICE
800 sq ft $300,000
1,000 sq ft $400,000
1,200 sq ft $500,000
1,500 sq ft $650,000

From these examples, our program calculates a simple relationship between house size and price.

EXAMPLE 01

Change One Training Value

Suppose the price of the 1,200 sq ft house changes from $500,000 to $600,000.

BEFORE 1,200 sq ft

$500,000

AFTER 1,200 sq ft

$600,000

We have not changed the house size. We changed only the known price.

The training data has changed.

Because our program calculates its relationship from this data, the calculated value can change.

The Learned Relationship Can Change

Remember this line from our Python program:

Python
price_per_sqft = sum(prices) / sum(sizes)

If the values inside prices change, the result of this calculation can also change.

OLD DATA Training Examples
OLD RELATIONSHIP Learned Value
OLD PREDICTION Output
CHANGED DATA New Training Examples
UPDATED RELATIONSHIP New Learned Value
NEW PREDICTION Different Output
EXAMPLE 02

What If We Add More Training Data?

Suppose we add another example:

NEW TRAINING EXAMPLE 1,800 sq ft → $750,000

Our program now has more information from which to calculate its relationship.

Python
sizes = [800, 1000, 1200, 1500, 1800]

prices = [300000, 400000, 500000, 650000, 750000]

The calculated relationship can therefore be different from the one obtained from the original four examples.

The Interesting Part: Same Input, Different Result

Suppose we ask the program to predict the price of a 1,400 sq ft house.

INPUT 1,400 sq ft
DATA VERSION A Prediction A
VS
DATA VERSION B Prediction B

The input did not change. The training data changed.

Different training data can lead to a different learned relationship and therefore a different prediction.

Real-World Example: House Prices

Imagine a house-price model trained several years ago.

The housing market changes over time. New houses are sold at different prices.

OLD DATA Historical Prices
MODEL Learned From History
NEW MARKET Prices Change

If the relationship in the real world changes significantly, the old model may no longer perform as well on new data.

Does More Data Always Make the Model Better?

No.

More data can be useful, but the quality and relevance of the data matter.

Useful Data

Examples that represent the real problem accurately can help the model learn useful patterns.

Poor Data

Incorrect, misleading, or irrelevant data can cause problems.

Changing Input vs Changing Training Data

CHANGE THE INPUT Prediction changes

The trained relationship stays the same, but we ask it about different data.

CHANGE THE TRAINING DATA What the model learns can change

A new training process can produce a different learned relationship.

What Happens When New Data Arrives?

In a real Machine Learning system, simply collecting new data does not automatically mean the existing model has learned from it.

01 New Data
02 Retraining / Updating
03 Updated Model
Important distinction:

New data and a new prediction are not the same thing. A model needs an appropriate training or updating process to learn from new data.

Two Simple Examples

EXAMPLE 01 Spam Detection

If new spam patterns appear, updating the training data can help a model adapt to those patterns.

EXAMPLE 02 House Prices

If market conditions change, newer housing data may be needed to keep the model useful.

Common Beginner Confusion

"If I give the model new data, does it automatically learn?"

Not necessarily. Prediction and training are separate processes.

"Does changing one example always make the model better?"

No. The new example could be inaccurate or unrepresentative.

"Can the same input produce different predictions?"

Yes, if the trained model or its learned parameters have changed.

KEY IDEA

Models learn from data, so the data matters.

Change the training data and what the model learns can change. Change the input and the prediction can change. These are two different things.

NEXT TOPIC

What Did We Learn?

We have now built a simple prediction system and explored how data affects it. Next, we'll review the main ideas from the entire lesson.