🏷️Classification vs Regression📈
Both are supervised learning tasks, but they answer different kinds of question. One sorts data into groups; the other predicts a number.
Run a moomz poll: who wins for you?
moomz.com — 10s, anonymous, free
🏷️Classification
- ✓Predicts which category or class an input belongs to
- ✓Output is a discrete label, like spam or not spam
- ✓Evaluated with accuracy, precision and recall
- ✓Examples: image recognition, disease diagnosis
- ✓Decision boundaries separate the classes
📈Regression
- ✓Predicts a continuous numerical value
- ✓Output is a number, like a price or temperature
- ✓Evaluated with error metrics like mean squared error
- ✓Examples: house price and stock value prediction
- ✓Fits a line or curve through the data
Verdict
Ask what kind of answer you need. If the output is a label or category, use classification; if it is a quantity on a continuous scale, use regression.
Frequently asked
How do I tell which task I have?+
If you predict a category, it is classification; if you predict a number, it is regression.
Is predicting house prices classification or regression?+
Regression, because the price is a continuous numeric value rather than a fixed category.
Can the same algorithm do both?+
Some, like decision trees and neural networks, can be adapted for either classification or regression.
Also in