Classification
Classification is predicting which category something belongs to, choosing from a fixed set of options learned from labelled examples.
Machine Learning
Key takeaways
- Classification picks from a fixed set of categories decided in advance.
- Accuracy is misleading on imbalanced data. Use precision and recall instead.
- Multiclass picks one category. Multilabel allows several at once.
- The 0.5 decision threshold is a default, not a correct answer.
Classification is predicting which category something belongs to. The set of categories is fixed and known in advance, and the model learns to sort new cases into them.
Spam or not spam. Which of ten digits. Which of five support queues. The defining feature is that the answer is one of a fixed list, not a number on a scale.
Think of it like this. Think of sorting post into pigeonholes. The pigeonholes were labelled before you started. Your job is deciding which one each letter goes in, not inventing new ones.
How it works
- Train on labelled examples, each tagged with its correct category.
- The model learns a boundary separating one category from another.
- New input gets scored against those boundaries.
- Output is a label or a probability. Probabilities are usually more useful, because they tell you how confident the model is.
Types
- Binary. Two categories. Spam or not.
- Multiclass. More than two, one answer each. Which digit is this.
- Multilabel. More than two, several answers allowed. An article can be about both politics and economics.
Common mistakes
- "Accuracy tells me how good it is." On imbalanced data it lies. If one percent of transactions are fraud, a model that never predicts fraud is ninety nine percent accurate and completely worthless.
- "Multiclass and multilabel are the same." Multiclass picks one. Multilabel allows several. Confusing them breaks the model setup.
- "The default threshold is right." Cutting at 0.5 is a convention, not a rule. Where a false negative costs more than a false positive, move it.
Learn it on DevLoom
Read it free, then practice it with exercises.