
What is Regression vs Classification?
Classification predicts a discrete category label ("spam" or "not spam"), while regression predicts a continuous numerical value (house price: β¬350,000). These are the two fundamental types of supervised machine learning problems β virtually every prediction task falls into one or the other.
Why It Matters
Choosing the right problem type determines the model architecture, loss function, evaluation metrics, and entire approach. Misframing a problem (treating a regression as classification or vice versa) leads to poor results. Understanding this distinction is the first step in any ML project.
How It Works
Classification:
- Output: discrete class label from a finite set
- Examples: spam detection (spam/not spam), image recognition (cat/dog/bird), diagnosis (positive/negative)
- Loss functions: cross-entropy, hinge loss
- Metrics: accuracy, precision, recall, F1, AUC-ROC
- Models: logistic regression, random forest, SVM, neural network classifier
Regression:
- Output: continuous numerical value
- Examples: house price prediction (β¬350K), temperature forecasting (21.5Β°C), stock price prediction, demand estimation
- Loss functions: MSE (mean squared error), MAE (mean absolute error)