Making Predictions
After a model has been trained, we can give it new data and ask it to produce an answer. This process is called making a prediction.
A trained model uses what it learned to answer new questions.
During training, the model learns patterns from existing examples. During prediction, we give the trained model new input that it has not seen before, and it uses those learned patterns to produce an output.
Training vs Prediction
These two stages are different.
The model receives data and learns patterns from it.
The trained model receives new data and produces an answer.
What Is a Prediction?
A prediction is the output produced by a trained machine learning model when it receives new input.
The output depends on the type of machine learning problem.
Example: Predicting a house price of $350,000.
Example: Predicting that an email is Spam.
The output depends on what the model was designed to predict.
Example: Predicting a House Price
Suppose we trained a model using thousands of houses.
The model learned relationships between information such as house size, bedrooms, location, and price.
Now we have a new house:
3 bedrooms
The model has never seen this exact house before. It uses the patterns learned during training to estimate its price.
The predicted price is an estimate produced by the model. It is not automatically the true selling price.
Example: Spam Detection
Prediction does not always mean predicting a number.
Consider a spam detection model.
During training, the model was given many emails labelled as Spam or Not Spam.
Now a new email arrives.
Here the model predicts a category instead of a numerical value.
The Model Does Not "Know" the Future
The word prediction can sometimes be misleading.
A machine learning model does not magically know what will happen in the future.
It uses patterns learned from existing data to estimate an output for new input.
A model cannot guarantee that its prediction will be correct.
It uses learned patterns to produce the most appropriate output it can.
One Model Can Make Many Predictions
Once a model has been trained, we can normally use it to make predictions for many new examples.
For example, a house-price model can receive different houses one after another.
The same trained model can process each new house and produce a prediction.
Prediction in a Real Application
Machine learning predictions are often used inside applications.
For example, an e-commerce website could use a trained model to predict whether a customer is likely to buy a product.
The application can then use that prediction for whatever business decision it was designed to support.
Prediction Is Not the End
After a model makes predictions, we need to determine how good those predictions actually are.
For example, if a model predicts a house price of $350,000 and the actual selling price is $370,000, we can measure the difference.
This leads to the next stage of the machine learning workflow: evaluating predictions.
Prediction Means Using a Trained Model on New Data.
The model does not simply memorize an answer. It uses patterns learned during training to produce an output for new input. That output may be a number, a category, or another type of result depending on the ML problem.
What Is Happening Here?
A house-price model was trained using 50,000 existing houses.
A new 2,000 sq ft house is given to the already-trained model, and the model predicts a price of $420,000.
This is a prediction.
The model has already learned patterns from the training data. It is now using those learned patterns to estimate the price of a new house.