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?
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.
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.
Examples
Houses, sizes, prices, customer records, emails, images, and other observations.
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.
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.
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.
In simple terms:
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.
Estimate the price of a house from its characteristics.
Decide whether an email is spam or not spam.
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.
A learned value controlling the relationship between size and price.
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.
Gather examples relevant to the problem.
Select a suitable learning method.
Use the examples to learn useful values.
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.
The model can now be used without repeating the entire learning process for every individual prediction.
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.
Can provide useful examples from which the model can learn.
Can lead the model toward relationships that do not work well on new data.
The Big Picture
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.