Classification Problems
A classification problem asks a Machine Learning model to determine which category an example belongs to.
Instead of predicting a number, we choose a category.
The model learns from previous examples and uses what it learned to assign a new example to one of the available categories.
What Is a Category?
A category is a group or class that an example can belong to.
The email belongs to the spam category.
The email belongs to the normal-email category.
The customer is predicted to purchase.
The customer is predicted not to purchase.
The Basic Classification Structure
Information about the example.
Uses patterns learned from previous examples.
The predicted class.
Example: Spam Detection
Spam detection is one of the easiest examples for understanding classification.
Words, sender information, links, and other available information.
Uses patterns learned from previous emails.
The predicted category.
The Model Learns From Examples
During training, we provide examples where the correct category is already known.
Category: Spam
Category: Not Spam
Category: Spam
Later, when it receives a new email, it can use the learned patterns to predict its category.
Binary Classification
When there are only two possible categories, the problem is called binary classification.
Another example is predicting whether a customer will buy or will not buy.
More Than Two Categories
Classification does not have to contain only two categories. A problem can have several possible classes.
If the model must choose between several possible categories, we have a multiclass classification problem.
Classification vs Numerical Prediction
The easiest way to distinguish classification from numerical prediction is to look at the type of output we want.
Example: Spam or Not Spam.
Example: House price = $420,000.
Real-World Classification Examples
Spam / Not Spam.
Fraudulent / Legitimate.
Will Buy / Will Not Buy.
Cat / Dog / Bird / Other class.
Classification Is Still a Prediction
Classification and numerical prediction may look different, but both are prediction problems.
Estimate an unknown outcome from known information.
The output belongs to one of the available classes.
Classification Predicts a Category
A classification model learns from labeled examples and predicts which category a new example belongs to.
Is This Classification?
Yes. The output is a category: Spam or Not Spam.
No. The output is a numerical value.
Yes. The output can be Fraudulent or Legitimate.