What is Binary Classification ?
Binary classification is a classification task where a model chooses between two possible classes.
Examples include:
- Spam or not spam
- Fraud or legitimate
- Disease present or absent
- Customer churn or no churn
The two classes are often represented as:
0 = negative class
1 = positive classHow it works
A neural network typically produces a score for the positive class. That score can be converted into a value between 0 and 1 and compared with a threshold.
For example:
Predicted probability = 0.82
Threshold = 0.50
0.82 > 0.50 → Positive classThe threshold does not always have to be 0.5; it can be adjusted depending on the cost of false positives and false negatives.
Common setup in deep learning
Binary classification commonly uses:
- A single output score
- The sigmoid activation function to produce a probability-like value
- Binary cross-entropy as the training loss
For the activation itself, see “What is the sigmoid activation function?”. Loss functions are introduced in “What is a loss function in deep learning?”.
Binary vs multiclass classification
Binary classification has exactly two classes. If a model must choose one class from three or more mutually exclusive classes, that is a multiclass classification problem.
In short, binary classification is the task of assigning an input to one of two possible classes, often using a probability-like score and a decision threshold.
Learning Sequence
Deep Learning Curriculum
Explore Related Questions
Deepen your understanding across related Deep Learning topics.