What is Classification?
What you'll learn: You'll discover how classification differs from regression by predicting categories instead of numbers.
From Numbers to Categories
So far, you've been working with regression — predicting continuous numerical values like house prices or temperatures. But what if you want to predict something that falls into distinct categories?
Classification is a supervised learning task where the goal is to predict which discrete category (or "class") a data point belongs to, rather than a continuous number.
Everyday Classification Examples
Classification problems surround us:
- Email filtering: Is this message spam or not spam? (2 categories)
- Medical diagnosis: Does this patient have disease A, B, C, or is healthy? (4 categories)
- Image recognition: Is this photo a cat, dog, or bird? (3 categories)
- Credit approval: Should we approve or deny this loan application? (2 categories)
Notice how each prediction is a label from a fixed set of possibilities, not a number on a continuous scale.
Classification vs Regression
The key difference:
- Regression: Predict a quantity → "This house will sell for $347,250"
- Classification: Predict a category → "This email is spam" or "This tumor is benign"
Think of it like sorting mail into bins versus weighing packages. Classification puts things into labeled boxes; regression measures them on a scale.
Binary and Multiclass
Classification problems come in flavors:
- Binary classification: Two possible outcomes (yes/no, spam/ham, positive/negative)
- Multiclass classification: Three or more categories (cat/dog/bird, disease types A-E)
Key Takeaway: Classification predicts discrete categories rather than continuous values, transforming real-world "which type?" questions into machine learning problems.