MACHINE LEARNING • LESSON 1 • HOW ML LEARNS

What Is a Model?

We now know that Machine Learning can learn useful relationships from examples. But after that learning happens, what do we actually have?

The answer is: a Machine Learning model.

A model is the learned representation of patterns from the training data that can be used to produce outputs for new inputs.

Think of a Model as the Result of Learning

Remember our house price example.

We gave the learning algorithm examples of houses and their prices.

TRAINING DATA House Examples
LEARNING Find Relationships
RESULT Model

The model is what we keep after the learning process so that we can use what was learned later.

A Model Is Not the Same as the Training Data

This distinction is important.

The training data contains the examples we gave to the learning algorithm.

The model represents what the algorithm learned from those examples.

TRAINING DATA

Examples

Houses, sizes, prices, customer records, emails, images, and other observations.

MODEL

Learned Relationship

A representation of useful patterns learned from those examples.

A Simple House Price Model

Let's use a very simple example.

Suppose our training data suggests that house size has a relationship with price.

SIMPLIFIED EXAMPLE Price = 0.05 × Size

This is a very simplified relationship.

If the size is measured in square feet and the relationship happens to fit our example data, the model can use this relationship to calculate an estimated price.

NEW INPUT 1,400 sq ft
MODEL Learned Relationship
OUTPUT Estimated Price

The important idea is not the particular formula. The important idea is that the model provides a way to turn an input into an output.

Think of the Model as a Function

One useful way to understand a Machine Learning model is to think of it as a function.

INPUT X
MODEL f(X)
OUTPUT ŷ

In simple terms:

SIMPLE IDEA Give the model an input, and the model produces an output based on what it learned.

Different Problems Need Different Models

There is not one single Machine Learning model that solves every problem.

Different algorithms can learn different kinds of relationships from data.

HOUSE PRICES Predict a Number

Estimate the price of a house from its characteristics.

SPAM DETECTION Predict a Category

Decide whether an email is spam or not spam.

IMAGE RECOGNITION Recognize Patterns

Use learned patterns to identify objects or categories in images.

What Is Inside a Model?

This is where Machine Learning starts becoming more mathematical.

A model usually contains learned values that determine how inputs are transformed into outputs.

These learned values are often called parameters.

SIMPLE EXAMPLE
Price = w × Size + b
w

A learned value controlling the relationship between size and price.

b

Another learned value that adjusts the output.

The exact mathematics depends on the Machine Learning algorithm being used. For now, remember the basic idea: training determines useful values that become part of the learned model.

How Does a Model Come Into Existence?

A model does not appear automatically just because we have data.

We choose a learning algorithm and give it training data. The algorithm uses that data to learn values that form the model.

01 Collect Data

Gather examples relevant to the problem.

02 Choose an Algorithm

Select a suitable learning method.

03 Train

Use the examples to learn useful values.

04 Get a Model

Keep the learned result for making predictions.

Once We Have a Model, We Can Use It

After training, we can give the model new data.

NEW HOUSE 1,600 sq ft
TRAINED MODEL Apply Learned Relationship
PREDICTION Estimated Price

The model can now be used without repeating the entire learning process for every individual prediction.

Training creates the model. Prediction uses the model.

This distinction will become very important when we discuss the difference between training and prediction in the next topic.

A Model Is Not Automatically Correct

A model represents patterns learned from data. That does not mean every prediction it makes will be correct.

The quality of the model depends on many things, including the data, the algorithm, the useful information available, and how well the learned relationship represents the real problem.

Good Training Data

Can provide useful examples from which the model can learn.

Poor Training Data

Can lead the model toward relationships that do not work well on new data.

The Big Picture

DATA Examples
TRAINING Learn Patterns
MODEL Learned Relationship
NEW DATA Make Prediction
KEY TAKEAWAY

A Machine Learning model is the learned representation that we use to make predictions.

Training data provides examples. The learning algorithm uses those examples to learn useful relationships. The resulting model can then be applied to new data.

NEXT TOPIC

Training vs Prediction

Now that we understand what a model is, we need to understand the two different stages: how the model learns from training data and how it is later used to make predictions.