What Is Classification?
Classification is a Machine Learning task where a model predicts which category or class an input belongs to.
Classification predicts a category instead of a numerical value.
The model looks at the features of an input, learns patterns from training data, and then predicts which class the new input belongs to.
What Is Classification?
Classification is used when we want a machine learning model to decide which category an input belongs to.
The model is not trying to predict an exact numerical value. It is trying to choose a category.
What Is a Class?
A class is simply a category or group that an input can belong to.
Here, Spam, Not Spam, Pass, and Fail are examples of classes.
Simple Example — Pass or Fail
Suppose we want to predict whether a student will pass an exam based on the number of hours they studied.
The model learns patterns from these examples.
Classification Uses Features and Labels
Classification uses the same basic idea of features and labels that we learned earlier.
Information about the student.
The category we want to predict.
For classification, the label represents a category such as Pass, Fail, Spam, or Not Spam.
Classification vs Regression
This is one of the most important differences to understand.
Example: predict a house price of ₹75,00,000.
Example: predict whether a student will Pass or Fail.
House → ₹75,00,000
Student → Pass
Real-World Example — Spam Detection
Classification is commonly used to identify whether an email is spam.
The model can use information such as:
The possible classes in this example are:
Real-World Example — Fraud Detection
A bank can use classification to determine whether a transaction is potentially fraudulent.
The Model Learns From Examples
A classification model learns from training examples where the correct class is already known.
Classification Can Use Probabilities
A classification model may internally estimate how likely each class is.
Based on these probabilities, the model may choose Pass as the predicted class.
Check Your Understanding
Classification answers: "Which category does this belong to?"
The model receives features, learns patterns from labeled training data, and predicts a class for new data.