MACHINE LEARNING • LESSON 1 • HOW ML LEARNS

What Does the Machine Learn?

We have seen how Machine Learning can use examples to make a prediction. But there is an important question:

What exactly is the machine learning from those examples?

The machine is not learning facts in the same way a human learns a subject. It is learning useful patterns and relationships in the data that can help it produce an output for new inputs.

It Is Not Simply Memorizing the Examples

Let's return to our house price example.

Suppose the training data contains these houses:

Size Price
1,000 sq ft $400,000
1,200 sq ft $500,000
1,500 sq ft $650,000

Now suppose we give the system a new house:

NEW INPUT 1,350 sq ft

The exact 1,350 sq ft house was not in the training examples.

A useful learning system should still be able to make a reasonable prediction.

This is why learning is more than memorization.

The system needs to capture something about the relationship between the input and the output so that it can handle new examples.

The Machine Learns Patterns

A pattern is a relationship that appears repeatedly in the data.

In our simplified house example, we might observe:

INPUT House Size
PATTERN Larger houses tend to cost more
OUTPUT House Price

This relationship is useful because it can help us estimate the price of a house that the system has not seen before.

A Pattern Is a Relationship Between Data

Machine Learning often tries to discover relationships between different pieces of information.

For example:

House Size → Price

Larger houses may generally have higher prices.

Study Time → Exam Score

More study time may be associated with better scores.

Email Information → Spam

Certain combinations of email characteristics may be associated with spam.

Customer Information → Purchase

Certain customer behaviors may be associated with purchasing a product.

What Goes Into the Learning Process?

The system needs examples.

Each example contains information that can help the algorithm discover a relationship.

INPUT House Size

1,200 sq ft

KNOWN RESULT Price

$500,000

The algorithm looks across many such examples instead of relying on just one house.

One Example Is Usually Not Enough

Suppose we only show the machine one house:

1,200 sq ft $500,000

There is not enough information to understand the general relationship between size and price.

But if we provide many examples:

800 sq ft $300K
1,000 sq ft $400K
1,200 sq ft $500K
1,500 sq ft $650K
1,800 sq ft $750K

the algorithm has more information from which to identify a useful relationship.

What Changes During Learning?

This is where Machine Learning differs from simply running a normal program.

During training, the learning algorithm uses the examples to determine values that help describe the relationship in the data.

Those learned values are then used when making predictions.

BEFORE TRAINING No learned relationship yet
TRAINING Learn from examples
AFTER TRAINING Learned relationship

Remember the Simple Math Example

Earlier, we manually found a simple relationship between house size and price.

SIMPLIFIED RELATIONSHIP Price = 0.05 × Size

We calculated that relationship ourselves.

In Machine Learning, an algorithm can use training data to determine the values that make the relationship useful for the problem.

The important idea:

The algorithm is trying to find values that allow the learned relationship to produce useful outputs for the examples and, ideally, for new data as well.

The Goal Is to Work on New Data

This is one of the most important ideas in Machine Learning.

A model that only performs well on the examples it has already seen is not very useful.

We want the learned relationship to also be useful when new data arrives.

TRAINING DATA Examples the model learns from
LEARNED PATTERN Relationship discovered from data
NEW DATA Make a useful prediction

What Does It Not Automatically Learn?

A Machine Learning system does not automatically understand everything about the real world.

If an important factor is missing from the data, the model cannot magically recover that information.

Missing Information

If location is not included in the house data, the model cannot use location directly.

Poor Examples

If the training examples are unreliable, the learned relationship can also be unreliable.

KEY IDEA

The machine learns useful relationships from examples.

It does not simply memorize the training examples. The goal is to learn a relationship that can be used to produce useful outputs for new inputs.

NEXT TOPIC

What Is a Model?

We now know that Machine Learning learns a useful relationship from data. But what do we call the result of that learning?